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.3.tar.gz (30.8 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.3-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: uel_toolcraft-0.1.3.tar.gz
  • Upload date:
  • Size: 30.8 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.3.tar.gz
Algorithm Hash digest
SHA256 1dd23178ffabef030d5d31b86a8acb14cef18e6961481ef6c1324a0a2ed9e5ad
MD5 9b06b2c6615cc474dfe28e47c55a4b7b
BLAKE2b-256 d9dc0df7de901a8c7d76481b629ef814de9a37c9915c32791ffff08b635fca1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for uel_toolcraft-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: uel_toolcraft-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 41.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 baa084d1646f4de5524d811cc21408eda6f4bcc24b358f06cc24b3511a8bae36
MD5 a3950982f90fb19b1746029fe0b15575
BLAKE2b-256 71841d2b0e2b165ac72647e65d60cee0600e50d710676832258f90d3fac13bd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for uel_toolcraft-0.1.3-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