semvec/pypi-packages huggingface dataset:
apikeylogger 1.1.1
This library allows you to log the OpenAI api usage *by key* without having to change your code
License: MIT
Requires Python: >=3.6
Keywords: openai,apikey,api,logger,tracker

# apikeylogger

Track your *OpenAI* api usage **by key**, without any code change.

#### Installation

```bash
pip install apikeylogger
```

#### Setup
Create a *.env* file with your OpenAI *api key* and *organization id* ([find yours here](https://platform.openai.com/account/organization)), like this:
```bash
OPENAI_API_KEY = ""
OPENAI_ORG_ID = ""
```


#### Usage
```python
# This call will transparently log your API usage by key in a local json file *apikeylogs.json*
from apikeylogger import track_openai
track_openai()

# Your normal code that uses openai
from openai import OpenAI
from dotenv import load_dotenv

load_dotenv()
client = OpenAI()

response = client.chat.completions.create(
    messages = [
        {
            "role": "user",
            "content": "What is the meaning of life?",
        }
    ],
    model = "gpt-3.5-turbo-0125" # any openai model
)

print(response.choices[0].message.content)
```

#### Test

Run tests with:
```bash
pytest
```
multicarriage 1.1
Allows the ability to rewrite multiple lines via carriage returns.
License: MIT
Requires Python: >=3.7

# multicarriage
![PyPI - Version](https://img.shields.io/pypi/v/multicarriage)
![Pepy Total Downlods](https://img.shields.io/pepy/dt/multicarriage)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/multicarriage)
![GitHub repo size](https://img.shields.io/github/repo-size/xyzpw/multicarriage)


A Python module designed for writing and updating text on multiple lines using the the carriage return.<br><br>
![multicarriage-preview](https://github.com/xyzpw/multicarriage/assets/76017734/fea181cd-3bbe-4ad5-beec-de6518033a2d)

## Usage
### Previewing Package
```bash
$ python3 -m multicarriage.demo
```
### Importing Package
```python
import multicarriage
```
### Creating Newlines
Creating newlines prevents text from being overwritten.
```python
multicarriage.MultiCarriage.create_newline(2)
```
### Writing to Screen
```python
multicarriage.MultiCarriage.write("first text", 2, clearline=True)
multicarriage.MultiCarriage.write("second text", 1, clearline=True)
```
Setting the `clearline` parameter to true will erase the current line of which the cursor is on, assuring there will be no overwritten text.
### Example of Real Script Usage
Example script that will write and update 3 lines at once.
```python
# example of auto updating epoch and datetime
import multicarriage
import time
import datetime

# creating newlines to avoid overwriting current text
multicarriage.MultiCarriage.create_newline(3)
while True:
    try:
        timestamp = time.time()
        date = datetime.datetime.fromtimestamp(timestamp)
        multicarriage.MultiCarriage.write(f"epoch: {timestamp}", 3, clearline=True, flushtxt=True)
        multicarriage.MultiCarriage.write(f"epoch (s): {timestamp//1}", 2, clearline=True, flushtxt=True)
        multicarriage.MultiCarriage.write(f"datetime string: {date}", 1, clearline=True, flushtxt=True)
        time.sleep(1/10)
    except KeyboardInterrupt:
        raise SystemExit(0)
```
libpt 0.4.2
Personal multitool
License: MIT
Requires Python: >=3.8
Keywords: library

# pt / libpt

![Project badge](https://img.shields.io/badge/language-Rust-blue.svg)
![Crates.io License](https://img.shields.io/crates/l/libpt)
![Gitea Release](https://img.shields.io/gitea/v/release/PlexSheep/pt?gitea_url=https%3A%2F%2Fgit.cscherr.de)
![Gitea language count](https://img.shields.io/gitea/languages/count/PlexSheep/pt?gitea_url=https%3A%2F%2Fgit.cscherr.de)
[![cargo checks and tests](https://github.com/PlexSheep/pt/actions/workflows/cargo.yaml/badge.svg)](https://github.com/PlexSheep/pt/actions/workflows/cargo.yaml)

![pt-logo](data/media/pt-logo.svg)

`pt` stands for either one of "personal tool", "plex tool", "pete" or something among those lines.
It is a collection of tools that i might or might not use. The intended purpose of this repo is that
I program whatever i feel is worth having in a personal thing into it, then use it as either a lib,
crate, python module or executable.

Let's see if I make it a bloated mess or stop committing after 30 hello worlds.

* [Original Repository](https://git.cscherr.de/PlexSheep/pt)
* [GitHub Mirror](https://github.com/PlexSheep/pt)
* [Codeberg Mirror](https://codeberg.org/PlexSheep/pt)
* [crates.io](https://crates.io/crates/libpt)
* [docs.rs](https://docs.rs/crate/libpt/)

## Dependencies

- See `cargo.toml`
- [openssl bindings for rust](https://docs.rs/openssl/latest/openssl/)
- [Python](https://www.python.org/)
- [`maturin`](https://maturin.rs) - `pip install maturin`

## Compiling & Installing from source

If you only want the rust library, you can simply build it with `cargo build`. Add it to your
project like any other local dependency.

If you want to use the python variant too, you need to compile with maturing.

- Install in `venv`: `maturin develop --release`
- Install in system: `maturin build --release && pip install target/wheels/libpt-x.x.x-*`

## Installing from [pypi](https://pypi.org)

`libpt` has been packaged for [pypi.org](https://pypi.org/project/libpt/).

You can install it with `pip install libpt`

## Installing from [crates.io](https://crates.io)

`libpt` has been packaged for [crates.io](https://crates.io/crates/libpt).

You can add the library to your project with `cargo add libpt`.

## Installing from my personal package registry

`libpt` has been packaged for [git.cscherr.de](https://git.cscherr.de).

You can add the registry to your `config.toml` and then `cargo add libpt`

[Package](https://git.cscherr.de/PlexSheep/-/packages/cargo/libpt/)

## Testing

Testing needs to be done separately for the rust and python parts:

- Rust testing with `cargo test`
- Python testing with `./scripts/pytests.sh` or `python -m unittest discover -fs tests/python`

## Documentation

The documentation can be automatically generated with `cargo doc --open`.

An up to date version of the Documentation can be found [here](https://docs.rs/libpt/)

## License

**Pt is MIT Licensed**