semvec/pypi-packages huggingface dataset:
cpu-heater 0.2.1
A Python parallel computing library
Requires Python: >=3.7

# CPU-Heater

A Python parallel computing library.

## Install

```py
pip install cpu-heater
```

## Usage

Multiprocessing:

```py
import cpu_heater

def adder(x, y):
    return x + y

def test_cpu_heater():
    args_list = [(i, i) for i in range(114514)]
    results = cpu_heater.multiprocess(
        adder,
        args_list,
        max_workers=8,
        show_progress=True,
        timeout=10,
        desc="test",
        not_none=True,
        extend_mode=False,
    )
    assert sorted(results) == sorted([i + i for i in range(114514)])
```

Multithreading:

```py
import cpu_heater

def adder(x, y):
    return x + y

def test_cpu_heater():
    args_list = [(i, i) for i in range(114514)]
    results = cpu_heater.multithreads(
        adder,
        args_list,
        max_workers=8,
        show_progress=True,
        desc="test",
        not_none=True,
        extend_mode=False,
    )
    assert sorted(results) == sorted([i + i for i in range(114514)])
```
simple-kvdb 1.0.0
一个轻量级的键值存储数据库，使用JSON文件格式
Requires Python: >=3.7
Keywords: database, key-value, json, storage, lightweight

# Simple KVDB

一个轻量级的键值存储数据库，使用JSON文件格式存储数据。

## 特性

- 🚀 简单易用的API
- 📁 使用JSON文件存储，数据可读性强
- 🔒 线程安全
- ⚡ 轻量级，无外部依赖
- 🛡️ 自动备份和错误处理
- 📊 支持复杂数据类型

## 安装

```bash
pip install simple-kvdb
```

## 快速开始

### 基本使用

```python
from simple_kvdb import KVDB

# 创建数据库实例
db = KVDB("my_database.json")

# 存储数据
db.set("user:1", {"name": "张三", "age": 25})
db.set("user:2", {"name": "李四", "age": 30})

# 获取数据
user = db.get("user:1")
print(user)  # {'name': '张三', 'age': 25}

# 检查键是否存在
if db.exists("user:1"):
    print("用户存在")

# 删除数据
db.delete("user:2")

# 获取所有键
all_keys = db.keys()
print(all_keys)  # ['user:1']

# 获取数据库大小
size = db.size()
print(f"数据库包含 {size} 个键值对")
```

### 高级功能

```python
from simple_kvdb import KVDB

db = KVDB("advanced_db.json")

# 批量操作
db.set_many({
    "config:theme": "dark",
    "config:language": "zh-CN",
    "stats:visits": 1000
})

# 获取多个值
values = db.get_many(["config:theme", "config:language"])
print(values)  # {'config:theme': 'dark', 'config:language': 'zh-CN'}

# 条件查询
theme = db.get("config:theme", default="light")
print(theme)  # dark

# 原子操作
db.atomic_update("stats:visits", lambda x: x + 1)

# 清空数据库
db.clear()

# 导出数据
data = db.export()
print(data)  # {}

# 从字典导入数据
db.import_data({"key1": "value1", "key2": "value2"})
```

### 上下文管理器

```python
from simple_kvdb import KVDB

# 使用上下文管理器确保数据安全保存
with KVDB("temp_db.json") as db:
    db.set("temp_key", "temp_value")
    # 退出时自动保存
```

## API 参考

### KVDB 类

#### 初始化参数

- `file_path` (str): 数据库文件路径
- `auto_save` (bool): 是否自动保存，默认为 True
- `backup_count` (int): 备份文件数量，默认为 3

#### 主要方法

- `set(key, value)`: 设置键值对
- `get(key, default=None)`: 获取值
- `delete(key)`: 删除键值对
- `exists(key)`: 检查键是否存在
- `keys()`: 获取所有键
- `values()`: 获取所有值
- `items()`: 获取所有键值对
- `size()`: 获取数据库大小
- `clear()`: 清空数据库
- `save()`: 手动保存数据
- `load()`: 重新加载数据
- `backup()`: 创建备份
- `set_many(data)`: 批量设置
- `get_many(keys)`: 批量获取
- `atomic_update(key, func)`: 原子更新
- `export()`: 导出数据
- `import_data(data)`: 导入数据

## 错误处理

```python
from simple_kvdb import KVDB, KVDBError

try:
    db = KVDB("test.json")
    db.set("key", "value")
except KVDBError as e:
    print(f"数据库错误: {e}")
```

## 性能考虑

- 对于大量数据，建议定期调用 `save()` 方法
- 使用 `auto_save=False` 可以提高写入性能
- 对于频繁访问的数据，考虑使用缓存

## 许可证

MIT License

## 贡献

欢迎提交 Issue 和 Pull Request！
async-crypto-pay-api 1.2.0
Async crypto pay api wrapper for t.me/cryptobot
Requires Python: >=3.10
Keywords: api, async, crypto, crypto pay api, cryptobot

# async-crypto-pay-api

![PyPI version](https://img.shields.io/pypi/v/async-crypto-pay-api)
![Python versions](https://img.shields.io/pypi/pyversions/async-crypto-pay-api)
![License](https://img.shields.io/pypi/l/async-crypto-pay-api)

Async Crypto Pay API wrapper for [Telegram Crypto Bot](https://t.me/cryptobot) written in Python 3.10+.

## Requirements
- Python 3.10 or higher
- Valid Crypto Bot API token ([get one here](https://t.me/CryptoBot?start=pay))

## Installation
```bash
pip install async-crypto-pay-api
```

## Example
```python
from asyncio import run
from async_crypto_pay_api import CryptoPayApi
from async_crypto_pay_api.models import CurrencyType, FiatAsset

crypto = CryptoPayApi("{token}")

async def main() -> None:
    # Context manager handles connection lifecycle
    async with crypto:
        app_info = await crypto.get_me()
        print(app_info.model_dump_json(indent=4))

        # Create payment invoice
        invoice = await crypto.create_invoice(
            currency_type=CurrencyType.FIAT,
            fiat=FiatAsset.USD,
            amount=100,
        )
        print(f"Invoice URL: {invoice.bot_invoice_url}")

run(main())
```

## License
This project is licensed under the GNU Lesser General Public License v3.0 only.
See [LICENSE](LICENSE) for details.


## Contributing
Contributions are welcome! Please open an issue or submit a PR for:
- Bug fixes
- New features
- Documentation improvements
liquisource 1.2.21
A liquibase datasource client for python
Requires Python: >=3.7

# liquibase数据源驱动
> liquibase引入python3脚本，统一管理管理mongo、clickhouse的库表结构。changelog记录还是选在记录到mysql中，这样业务上会更加灵活
```xml
<changeSet id="xxxxx" author="xxxxxx" labels="mongo">
    <comment>xxxxx</comment>
    <executeCommand executable="python3">
        <arg value="script/db_tag/creat_collection.py"/>
    </executeCommand>
</changeSet>
```
```python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from liquibase_datasource import *


def create_tag_database():
    # 获取mongo链接实例
    client = get_client(filepath)


    return client[db]


def create_tag_collection():
    # 获取mongo链接实例
    db_name = get_tenant_shard(tag_database)
    client = get_client()
    db = client[db_name]

    # db开启分片
    client.admin.command("enableSharding", db_name)

    db.create_collection(tag_collection)

    # 创建索引
    coll = db[tag_collection]
    coll.create_index(
        [("id", 1), ("name", 1)])


if __name__ == "__main__":
    # 创建标签集合
    create_tag_database()[run.py](..%2F..%2F..%2FDownloads%2Frun.py)
    create_tag_collection()

```

## 发布包
```python
python3 -m pip install --upgrade build
python3 -m build
python3 -m pip install --upgrade twine
python3 -m twine upload  dist/*

```