python tools
Project description
pykit-tools
Some methods and decorators commonly used in Python development are encapsulated into lib for easy access and use by other projects.
Python开发经常用的一些方法和装饰器,封装成lib方便其他项目接入使用。
1. 安装
pip install pykit-tools
可查看版本变更记录 ChangeLog
2. 使用(Usage)
各函数具体使用说明可以查看源码注释。
2.1 装饰器decorator
handle_exception
用于捕获函数异常,并在出现异常的时候返回默认值time_record
函数耗时统计method_deco_cache
方法缓存结果, 只能缓存json序列化的数据类型
2.2 日志log相关
MultiProcessTimedRotatingFileHandler
多进程使用的LoggerHandlerLoggerFormatAdapter
日志按照字典字段格式化输出
2.3 设计模式
Singleton
单例类
2.4 其他工具集
cmd.exec_command
执行shell命令str_tool.compute_md5
根据输入的参数计算出唯一值(将参数值拼接后最后计算md5)
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
pykit_tools-1.0.0.tar.gz
(18.6 kB
view details)
Built Distribution
File details
Details for the file pykit_tools-1.0.0.tar.gz
.
File metadata
- Download URL: pykit_tools-1.0.0.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 940172cc136d558a57202ae4542afaeaf84233c8bb9e3f584431d378253f40c7 |
|
MD5 | 27b1ab163cb15b76fadc5cc53bcf0143 |
|
BLAKE2b-256 | e029cd523480f970024f1eb3199eb3d0abff9780906ffc878b500644aedbbf72 |
File details
Details for the file pykit_tools-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pykit_tools-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64d99e0c8c2797d9d3450588557ffd5587b4b7b4d2bb55a1e46a83f4fe46b5d8 |
|
MD5 | 8a7fa4729caf95b45c2718f729a26620 |
|
BLAKE2b-256 | 4e22574b59fc1df525dd1ac851b154fe07d773a220d3c411ea744e21a1ce6335 |