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
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 uel_toolcraft-0.1.5.tar.gz.
File metadata
- Download URL: uel_toolcraft-0.1.5.tar.gz
- Upload date:
- Size: 45.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4f023004749ca7fbb59e5a6a832778e38a77032787ab6c0a31b877b6136ace0
|
|
| MD5 |
27cbe526f052c53cbb1dc412191829af
|
|
| BLAKE2b-256 |
2f9c53e9e02af9e2498df94b75acc8db7b26587a77de3f766aaee2649e50fc72
|
Provenance
The following attestation bundles were made for uel_toolcraft-0.1.5.tar.gz:
Publisher:
publish-pypi.yml on Ausaci/uel-toolcraft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uel_toolcraft-0.1.5.tar.gz -
Subject digest:
e4f023004749ca7fbb59e5a6a832778e38a77032787ab6c0a31b877b6136ace0 - Sigstore transparency entry: 1614654278
- Sigstore integration time:
-
Permalink:
Ausaci/uel-toolcraft@1f3d3bd092fa791e6f53af24001b355934b441f2 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Ausaci
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@1f3d3bd092fa791e6f53af24001b355934b441f2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file uel_toolcraft-0.1.5-py3-none-any.whl.
File metadata
- Download URL: uel_toolcraft-0.1.5-py3-none-any.whl
- Upload date:
- Size: 60.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
645996c10abc946303cabdb75ccec6eadccdd53e5615cafe23d42ca45ec25577
|
|
| MD5 |
657d63b93e8dadf6732b905bad816341
|
|
| BLAKE2b-256 |
d89e326231eedad9207c1b42bed6f22c8010612f2f34950086365f920b4eba43
|
Provenance
The following attestation bundles were made for uel_toolcraft-0.1.5-py3-none-any.whl:
Publisher:
publish-pypi.yml on Ausaci/uel-toolcraft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uel_toolcraft-0.1.5-py3-none-any.whl -
Subject digest:
645996c10abc946303cabdb75ccec6eadccdd53e5615cafe23d42ca45ec25577 - Sigstore transparency entry: 1614654314
- Sigstore integration time:
-
Permalink:
Ausaci/uel-toolcraft@1f3d3bd092fa791e6f53af24001b355934b441f2 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Ausaci
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@1f3d3bd092fa791e6f53af24001b355934b441f2 -
Trigger Event:
push
-
Statement type: