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 and TOML 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)

Public API Overview

Core

  • configure
  • log
  • mask

File helpers

  • read
  • write
  • read_json
  • write_json
  • read_toml
  • write_toml

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.2.1.tar.gz (22.2 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.2.1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file clevertools-1.2.1.tar.gz.

File metadata

  • Download URL: clevertools-1.2.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clevertools-1.2.1.tar.gz
Algorithm Hash digest
SHA256 741134b590d0e388a716ae5cb92cc999af7e82e984f9d538c947eb85ba4f851c
MD5 1c8f8ebae4eb801f8787fd619fd0890e
BLAKE2b-256 cdfbd5527d649af8fc4feaa1231e2d1a70a53027ad4d7f60d276ab4a6c5a0e68

See more details on using hashes here.

File details

Details for the file clevertools-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: clevertools-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 26.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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e74bd990ca43e767af082aa2c3aaefaa38fceeb986e19e36c2c167b41e9e506
MD5 5ee4d65058fcfea6eaae2a2729a2b19b
BLAKE2b-256 dc5e4372760852fe7e80867e800c9bf4d2cfa856df04585f5ac2068e3a06236a

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