Skip to main content

A Unified Essential Library toolcraft (uel-toolcraft) for personal usage.

Project description

uel-toolcraft

A Unified Essential Library toolcraft for personal usage.

Installation

pip install uel-toolcraft

Install with optional dependencies:

# Core only (explicit — same as pip install uel-toolcraft)
pip install uel-toolcraft[core]

# All optional dependencies (excludes PyQt6 — install [pyqt] separately if needed)
pip install uel-toolcraft[all]

# Specific extras
pip install uel-toolcraft[pyqt,ffmpeg,git]

# Everything including PyQt6
pip install uel-toolcraft[all,pyqt]

# NTP time sync (requires ntplib)
pip install uel-toolcraft[ntp]

Local development install:

git clone https://github.com/iShengren/uel-toolcraft.git
cd uel-toolcraft
uv pip install -e ".[all]"

Usage

Models

from uel_toolcraft.models import AESCipher, SQLiteHelper, BarkClient

cipher = AESCipher("my-secret-key")
db = SQLiteHelper("mydb.sqlite")
bark = BarkClient("https://bark.example.com", "device_key")

Tools

from uel_toolcraft.tools import read_json_file, write_json_file, md5sum

data = read_json_file("config.json")
checksum = md5sum("large_file.bin")
write_json_file({"key": "value"}, "output.json")

CLI

uel-toolcraft --version
python -m uel_toolcraft --version

Time & NTP

from uel_toolcraft.tools import get_current_timestamp, current_datetime_str, get_ntp_time, set_system_time

# 基础时间
ts = get_current_timestamp()          # Unix 时间戳(秒)
ts_ms = get_current_timestamp_ms()    # Unix 时间戳(毫秒)
now = current_datetime_str()          # "2026-05-22 10:37:28"

# NTP 网络时间同步
ntp_ts = get_ntp_time("pool.ntp.org") # 补偿延迟后的精确时间戳
set_system_time(int(ntp_ts * 1000))   # 同步到系统时钟(需管理员权限)

Logging

LogConfig 提供彩色控制台日志 + 可选文件日志,并自动屏蔽吵杂的第三方库日志。

from uel_toolcraft.models import LogConfig

LogConfig(level=logging.INFO, log_file="app.log", block_loggers=["noisy_lib_1", "noisy_lib_2"])

屏蔽第三方库日志 — 在项目的 pyproject.toml 中配置:

[tool.uel-toolcraft.logging]
block_loggers = ["boto3", "azure.core", "googleapiclient"]

也可以通过参数显式传入:

LogConfig(level=logging.INFO, log_file="app.log", block_loggers=["noisy_lib_1", "noisy_lib_2"])

合并规则:内置默认 (httpx, urllib3) + pyproject.toml 中的 + 参数传入的 → 三源并集自动去重。

get_logger 在配置 LogConfig 的同时返回 logging.Logger 对象


Optional Dependencies

Extra Packages Used by
core (none) Explicit core-only install
pyqt PyQt6 PyQtAsyncHelper, ui_tools
ffmpeg ffmpeg-python ffmpeg_tools
rclone rclone-python rclone_tools
supabase supabase supabase_tools
git GitPython git_tools
redis upstash-redis redis_upstash
ntp ntplib time_tools

License

MIT

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

uel_toolcraft-0.1.4.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

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

uel_toolcraft-0.1.4-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file uel_toolcraft-0.1.4.tar.gz.

File metadata

  • Download URL: uel_toolcraft-0.1.4.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uel_toolcraft-0.1.4.tar.gz
Algorithm Hash digest
SHA256 fb542672db036c289b1ef16f5f9301822c8ee8404755e1f5c9047f7156a2f459
MD5 e99c18dbb038f031ee135d1af54d997e
BLAKE2b-256 c0b79fcea0568cc8a6b8b82af4dff5ec6a943217ed6f0db096d62096ebd9d009

See more details on using hashes here.

Provenance

The following attestation bundles were made for uel_toolcraft-0.1.4.tar.gz:

Publisher: publish-pypi.yml on Ausaci/uel-toolcraft

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

File details

Details for the file uel_toolcraft-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: uel_toolcraft-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 41.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uel_toolcraft-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5072d7d414d4c763947b263242c4d02d725f787c1926457ab0432dc3dfe40530
MD5 4b68a9e0f91ea5549d6673ae597150e5
BLAKE2b-256 612059f63ff7f24d50af206f6e936279dc238ad23b9e0155a51074fb5f3ecce1

See more details on using hashes here.

Provenance

The following attestation bundles were made for uel_toolcraft-0.1.4-py3-none-any.whl:

Publisher: publish-pypi.yml on Ausaci/uel-toolcraft

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