A collection of utility functions
Project description
Zampie Utils
一个实用的Python工具包,提供了一系列常用的工具函数。
功能特性
- 文件操作工具
- 计时器上下文管理器
- 表情符号和表情识别
- 概率触发器
- 会话保存功能
- 智能日志系统(支持自动滚动日志)
安装
pip install zampie_utils
使用示例
from zampie_utils import ContextTimer, read_file
from zampie_utils.logger import Logger
# 使用计时器
with ContextTimer("my_task", "s"):
# 你的代码
pass
# 读取文件
content = read_file("path/to/your/file.txt")
# 使用滚动日志
logger = Logger()
# 添加文件处理器,设置最大文件大小为10MB,保留5个备份文件
logger.add_file_handler("app.log", max_bytes=10*1024*1024, backup_count=5)
logger.info("这是一条日志消息")
PyPi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zampie_utils-0.8.8.tar.gz
(27.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zampie_utils-0.8.8.tar.gz.
File metadata
- Download URL: zampie_utils-0.8.8.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37806b954df78e230d205db5d032a10c9494412218cac6d8ca6e5be053b0acc9
|
|
| MD5 |
2c79ae84d87c94ebf6718fea104ee5fa
|
|
| BLAKE2b-256 |
f7d819feb04331715c37a27acf39d8de43f5d3fe64664230d510e8851863a036
|
File details
Details for the file zampie_utils-0.8.8-py3-none-any.whl.
File metadata
- Download URL: zampie_utils-0.8.8-py3-none-any.whl
- Upload date:
- Size: 31.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c925af1c3023893dc7b87e41a65e9a8f3c91e805ef08e2757a4eeabd8d80c7a
|
|
| MD5 |
3f066fa9b8a538cf8d60542d81d711a6
|
|
| BLAKE2b-256 |
5d71a0bba3bd3dda06a77ae2077b61ff6adebe7b9a8aebe61a5997942585b6b7
|