Skip to main content

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

https://pypi.org/project/zampie-utils/

Project details


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.9.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zampie_utils-0.8.9-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file zampie_utils-0.8.9.tar.gz.

File metadata

  • Download URL: zampie_utils-0.8.9.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for zampie_utils-0.8.9.tar.gz
Algorithm Hash digest
SHA256 e1500a4f9708ffd1e306c3b4dde65c23a1902feb81c49310f15fb795a4bf688f
MD5 154457408082d5021a1297aa2542cef2
BLAKE2b-256 00c7c49ea02e42edda2449cdbe00d3f45126b86fd64ce1eb5f87bd06462af16a

See more details on using hashes here.

File details

Details for the file zampie_utils-0.8.9-py3-none-any.whl.

File metadata

File hashes

Hashes for zampie_utils-0.8.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a1af31ff00e74d3622ddafb08acac9f65c9d7803bb2c3eb9adaca05255d2fa1f
MD5 ab56bd978ad43b5b25be5c9bb60f895c
BLAKE2b-256 acc85a680fef5153934ded607448dd3d540f12b9f1ea2c309ebdb279ce61bffa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page