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.0.tar.gz (6.1 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.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for liforra_utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 86d532f0dbb85b6cdc0be2ed0980395627b340921e86d39e639c9b9a3e12fa2e
MD5 d9a356dc8d8f0d0b0f28de27ec410603
BLAKE2b-256 e3ac68a292f2a7f3d9d92f1eb4e3f6e53921a6f00bab1b6e677569191d9031d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for liforra_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a45696fa7b989d0e581aedbf99c32c8b463fd48ba8908ffdf028170c082dad87
MD5 8892ac49cd7ff2bca127e102ca14284e
BLAKE2b-256 5aa32497ce24ad8da00609c7374f672749326794b28e584c73cd4e9c1925dd2c

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