Skip to main content

Small logging and config helper utilities

Project description

lutils

Small logging and config helpers.

Features

  • Logging helper with consistent levels, optional color output, and optional file output.
  • Config helper with dot-delimited keys and auto-create on missing values.
  • Supports TOML/INI/JSON/YAML formats depending on installed parsers.
  • Lightweight, minimal dependencies.

Examples

Logging:

import lutils

lutils.set_log_level("debug")
lutils.log("info", "Hello from lutils")

Config (auto-creates missing values when a default is given):

import lutils

lutils.config.set("app.name", "beeper")
print(lutils.config.get("app.name"))
print(lutils.config.get("missing.value", "fallback"))

Config file selection (defaults to ./config.*):

import lutils

lutils.config.set_name("settings")
lutils.config.set_path("./")

Optional dependencies

lutils uses optional parsers if you have them installed:

  • toml (only needed on Python < 3.11; Python 3.11+ uses tomllib)
  • PyYAML for YAML support
  • coloredlogs for colored log output

Install with extras (recommended):

pip install "lutils[toml,yaml,colors]"

Individual extras:

pip install "lutils[toml]"   # TOML on Python < 3.11
pip install "lutils[yaml]"   # YAML support
pip install "lutils[colors]" # coloredlogs output

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

liforra_utils-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

liforra_utils-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file liforra_utils-0.1.1.tar.gz.

File metadata

  • Download URL: liforra_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for liforra_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 454a9e68ddd9c7a18066a1daca942b7a79551ff9efccbd6975161ca339decf76
MD5 6b3473fa5a33549b25770fa2abb37b29
BLAKE2b-256 9a83c6462218f282525b25f70a8d275c99b0e5ad0c2d17640c140690d0aa43af

See more details on using hashes here.

File details

Details for the file liforra_utils-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for liforra_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28049dc065f36dbd7d9119bd7d07d5231169a79d88f8e7cf38593ac3d8d6d3f2
MD5 729937dead0c897fed77399cf2da02af
BLAKE2b-256 a0f35f8f97597e84b330040255ae83f613246dbb3b51b659ca4edc91e1639a33

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