Clevertools is a utility library providing practical tools for common workflows.
Project description
clevertools
clevertools is a compact Python utility library for everyday workflows like file I/O, masking sensitive values, runtime configuration, and logger setup.
What You Get
- simple text and binary file helpers
- JSON, TOML, and YAML read/write helpers
- masking for tokens, secrets, IDs, and similar values
- global configuration for shared error behavior
- ready-to-use console and file logging
- lower-level logging utilities when you need more control
Quick Example
from clevertools import configure, configure_logger, mask, read_json, write_json
configure(
error_mode="raise",
logger_overrides={
"level": "INFO",
"console_enabled": True,
},
)
logger = configure_logger(name="demo", use_colors=False)
payload = {
"service": "billing",
"token": mask("sk-demo-123456789", 4, 3),
}
write_json("tmp/config.json", payload)
loaded = read_json("tmp/config.json")
logger.info("Loaded config: %s", loaded)
For split configuration setups, load_config() merges multiple TOML, JSON, or YAML files into one config object with dot access.
Public API Overview
Core
configurelogmask
File helpers
readwriteread_jsonwrite_jsonread_tomlwrite_tomlread_yamlwrite_yamlload_config
Logging helpers
configure_loggerget_loggerCleverToolsFormatterbuild_console_handlerbuild_file_handlerreset_handlersresolve_logger_options
Why It Exists
clevertools stays intentionally small. It focuses on practical helpers that are easy to drop into scripts and small projects without turning simple tasks into a framework.
Repository Guide
- docs/README.md is the documentation entry point
- docs/installation.md shows local setup
- docs/quickstart.md shows an end-to-end example
- docs/tools/README.md lists every tool page
- docs/concepts/README.md explains shared behavior
- src/clevertools contains the implementation
- tests contains the test suite
Installation
pip install -e .
For a full local setup, see docs/installation.md.
Requirements
- Python
>=3.11
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 clevertools-1.3.1.tar.gz.
File metadata
- Download URL: clevertools-1.3.1.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b32875c12487400998ba5a2a34b7a864b900e2943bb2c5f810f99c6899d12cd
|
|
| MD5 |
391d4f6d4ce94297265d4a0d6ec7cdd6
|
|
| BLAKE2b-256 |
26020ea2abec64045f50d548f3c98c228399cc9aa070fe7ca1c82fddcf9e5643
|
File details
Details for the file clevertools-1.3.1-py3-none-any.whl.
File metadata
- Download URL: clevertools-1.3.1-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8086825294706dc77fa87cb50c9b59ffee264122007fec4c7461bff65ff4ea2e
|
|
| MD5 |
66d48c9f2e520e91fee6d0cca57ad261
|
|
| BLAKE2b-256 |
f8eb0cccd4c9011d0d92e4c550a85e6fb4bd829d758b08f0d1f3c0fe4bbda0f9
|