一个实用工具库,包含日志管理、单例模式、注册表、成本管理、多功能函数和数据协议等模块,帮助你快速构建和管理 Python 项目。
Project description
cr_utils
cr_utils 是一个实用工具库,包含日志管理、单例模式、注册表、成本管理、多功能函数和数据协议等模块,帮助你快速构建和管理 Python 项目。
主要模块和功能
Logger
提供日志管理功能,方便统一日志输出和自定义日志行为。
Singleton
实现单例模式,确保类只有一个实例。
Registry
提供注册表功能,便于管理和调用各种插件或功能模块。
CostManagers
成本管理工具,用于监控和管理资源消耗。
Function 模块功能函数
set_variable_with_default:设置环境变量。killall_processes:结束所有指定的进程。make_main:设置 debug 等功能。make_async/make_sync:辅助函数,实现异步和同步的转换。custom_before_log/custom_after_log:日志自定义钩子。read_jsonl/write_jsonl:读取和写入 JSON Lines 格式文件。encode_image:图片编码功能。
Protocol
ParamProto:定义数据协议格式,规范数据交互,便于参数传递。
LLM 相关
Chater:聊天机器人或对话管理器。extract_any_blocks、extract_code_blocks、extract_json_blocks:从文本中提取不同格式的数据块。
安装
pip install cr_utils
pip install git+https://github.com/cbxgss/cr_utils.git
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
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 cr_utils-0.3.1.tar.gz.
File metadata
- Download URL: cr_utils-0.3.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ceae195c59471ccc39206cfa5d5e82706aa82db81dc464a084df6d0437fce49
|
|
| MD5 |
e8d0334a4eab47c40bdd06b534f4b61b
|
|
| BLAKE2b-256 |
f3004023bd5ac395e759ec06a8ba7f73aa807c2ecb80311fee99b3565939922a
|
Provenance
The following attestation bundles were made for cr_utils-0.3.1.tar.gz:
Publisher:
publish.yml on cbxgss/cr_utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cr_utils-0.3.1.tar.gz -
Subject digest:
1ceae195c59471ccc39206cfa5d5e82706aa82db81dc464a084df6d0437fce49 - Sigstore transparency entry: 779858916
- Sigstore integration time:
-
Permalink:
cbxgss/cr_utils@6c5047fa33548db650410bbc821b37530018e771 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cbxgss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c5047fa33548db650410bbc821b37530018e771 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cr_utils-0.3.1-py3-none-any.whl.
File metadata
- Download URL: cr_utils-0.3.1-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ab497c8f41ff9e47f17a857e256c28e110a14a3a42f13382cf3310df8359be3
|
|
| MD5 |
74ecad61b835e79c427345f013a8ccac
|
|
| BLAKE2b-256 |
9627363abd4def9dcbab3beefa8e17f8e488a12679030ca9766600deabd535c6
|
Provenance
The following attestation bundles were made for cr_utils-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on cbxgss/cr_utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cr_utils-0.3.1-py3-none-any.whl -
Subject digest:
8ab497c8f41ff9e47f17a857e256c28e110a14a3a42f13382cf3310df8359be3 - Sigstore transparency entry: 779858918
- Sigstore integration time:
-
Permalink:
cbxgss/cr_utils@6c5047fa33548db650410bbc821b37530018e771 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cbxgss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c5047fa33548db650410bbc821b37530018e771 -
Trigger Event:
push
-
Statement type: