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.2.tar.gz (6.5 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.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for liforra_utils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 18649da17965c6799e812a02cc58ef7d092a25c9969e57cac1acbd0a9ba9aacc
MD5 3fdfc9cf09525e8e615e113e712b6c3f
BLAKE2b-256 e5edfa31fb99c4b71c99d5eb7af41813ff2a03bdbd4575a8b9c62a71949011ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for liforra_utils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 95381707677dc83686521756cb3a9510143b3ef4380c2c366984afb499da9a50
MD5 f9edd7a24a47d6fff1e05244e91e8a3c
BLAKE2b-256 75b05641b0814052563145d7972c5cb4a60c64fbdf4ac6a3ef8d423defe8a904

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