Skip to main content

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

  • configure
  • log
  • mask

File helpers

  • read
  • write
  • read_json
  • write_json
  • read_toml
  • write_toml
  • read_yaml
  • write_yaml
  • load_config

Logging helpers

  • configure_logger
  • get_logger
  • CleverToolsFormatter
  • build_console_handler
  • build_file_handler
  • reset_handlers
  • resolve_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

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

clevertools-1.3.1.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

clevertools-1.3.1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

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

Hashes for clevertools-1.3.1.tar.gz
Algorithm Hash digest
SHA256 0b32875c12487400998ba5a2a34b7a864b900e2943bb2c5f810f99c6899d12cd
MD5 391d4f6d4ce94297265d4a0d6ec7cdd6
BLAKE2b-256 26020ea2abec64045f50d548f3c98c228399cc9aa070fe7ca1c82fddcf9e5643

See more details on using hashes here.

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

Hashes for clevertools-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8086825294706dc77fa87cb50c9b59ffee264122007fec4c7461bff65ff4ea2e
MD5 66d48c9f2e520e91fee6d0cca57ad261
BLAKE2b-256 f8eb0cccd4c9011d0d92e4c550a85e6fb4bd829d758b08f0d1f3c0fe4bbda0f9

See more details on using hashes here.

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