zbig - Big Zhu Python Utility Library
一个包含各种实用工具的 Python 库,主要用于个人开发项目。
安装
pip install zbig
功能模块
zfile - 文件操作
- CSV 文件读写操作
- 支持重复数据检测
- 批量数据处理
ztelegram - Telegram 集成
- 消息发送
- 图片发送
- 支持中国时区时间戳
zprint - 增强打印
- 表格格式化输出
- 支持中文字符宽度计算
- 实时刷新表格显示
ztime - 时间工具
- 中国时区时间格式化
- 统一的时间戳格式
zcache - 缓存工具
- JSON 文件缓存装饰器
- 可配置缓存生命周期
- 自动缓存清理
- UTF-8 支持与性能优化
zhash - 哈希工具
- 函数参数哈希计算
- 一致性哈希生成
zlog - 日志系统
- 统一的日志配置
- 多级别日志支持
- 灵活的格式化配置
zconfig - 配置管理
- 环境变量管理
- .env 文件支持
- 配置验证机制
使用示例
# CSV 操作
from zbig.zfile.zcsv import read_csv, write_csv_append
header, rows = read_csv("data.csv")
write_csv_append("data.csv", ["new", "row", "data"])
# 缓存装饰器
from zbig.zcache.json_cache import cache
@cache(life_second=3600) # 1小时缓存
def expensive_function(param):
# 耗时操作
return result
# 时间格式化
from zbig.ztime.cn_now import cn_now
print(cn_now()) # 2024-01-01 12:00:00
# 表格打印
from zbig.zprint.table import table
table([['Name', 'Age'], ['Alice', '25']], " ")
开发
环境设置
# 安装依赖
poetry install
# 安装预提交钩子
pre-commit install
# 运行测试
poetry run pytest
# 代码格式化
poetry run ruff format zbig
# 类型检查
poetry run mypy zbig
更新日志
0.1.20
- 添加完整的测试套件
- 改进类型注解
- 添加开发工具配置
- 修复拼写错误
0.1.14
- curses_table 自动刷新功能
0.1.13
- 增加 curses_table
0.1.9
- 支持非英文的 table print
test
pytest
Metadata
Release files for zbig 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zbig-0.2.2.tar.gz | 9.6 kB | Without provenance | Details for zbig-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zbig-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for zbig-0.2.2-py3-none-any.whl |
Total release size: 23.5 kB
Release files / zbig-0.2.2.tar.gz
| Download URL | zbig-0.2.2.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f7b303abf4077556463fb3592c683fa7eb086373ebf4db67b2f0b56cad0fa5c
|
|
BLAKE2b-256 checksum How to use checksums |
51542cd72fb28549042b0166d540f57c835332ef1982cfe55cf0d8459b0dc2de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1018-azure
|
Release files / zbig-0.2.2-py3-none-any.whl
| Download URL | zbig-0.2.2-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d769310d4ce9110ab162015d1414b329b1dd55a01f8acb4c1552d4499ed61133
|
|
BLAKE2b-256 checksum How to use checksums |
0720f7901d36bd1152c9eb7d8d740be69feb365ad4be0c5159aa0e5c6c29fd5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1018-azure
|
Security for zbig 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.