Skip to main content

一个实用工具库,包含日志管理、单例模式、注册表、成本管理、多功能函数和数据协议等模块,帮助你快速构建和管理 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_blocksextract_code_blocksextract_json_blocks:从文本中提取不同格式的数据块。

安装

pip install cr_utils
pip install git+https://github.com/cbxgss/cr_utils.git

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

cr_utils-0.2.9.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

cr_utils-0.2.9-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file cr_utils-0.2.9.tar.gz.

File metadata

  • Download URL: cr_utils-0.2.9.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cr_utils-0.2.9.tar.gz
Algorithm Hash digest
SHA256 a7a8eedbb278e50b5997e41a27366439e0688ae50b628d4e88a26674153022f4
MD5 d84e65562bc3f99caf2e60a3534389f1
BLAKE2b-256 28ab2ec4ec9b8bf938c43f3c6245b39f38f71eca31f60c37b7285a9e11a71522

See more details on using hashes here.

Provenance

The following attestation bundles were made for cr_utils-0.2.9.tar.gz:

Publisher: publish.yml on cbxgss/cr_utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cr_utils-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: cr_utils-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cr_utils-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 60dcb52d2e7192573c67a348cbf85822392a7ad5a10575c0ac33511ad7cf89fc
MD5 47300fd6a336092b1bc7b570cd94716f
BLAKE2b-256 dc18c8692f0d0beaf350134b801f0769be2be675bd70a91e6107d2cf56fda162

See more details on using hashes here.

Provenance

The following attestation bundles were made for cr_utils-0.2.9-py3-none-any.whl:

Publisher: publish.yml on cbxgss/cr_utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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