The universal .env and configuration library. One API for every language.
Project description
dotlyte — Python
The universal .env and configuration library for Python.
Installation
pip install dotlyte
Quick Start
from dotlyte import load
config = load()
config.port # automatically int
config.debug # automatically bool
config.database.host # dot-notation access
Features
- Zero-config start —
load()with no arguments just works .envfile loading — auto-detects.env,.env.local,.env.{env}- YAML, JSON, TOML support —
config.yaml,config.json,config.toml - Layered priority — env vars >
.env> YAML > JSON > TOML > defaults - Type coercion —
"true"→True,"8080"→8080,"a,b,c"→["a", "b", "c"] - Dot-notation access —
config.database.host - Safe access —
config.get("key", default) - Required access —
config.require("key")throws if missing - Prefix stripping —
APP_DB_HOST→config.db.host
Advanced Usage
config = load(
files=["config.yaml", ".env.production"],
prefix="APP",
defaults={"port": 3000, "debug": False},
env="production",
)
API
load(**options) → Config
| Option | Type | Description |
|---|---|---|
files |
list[str] |
Explicit files to load |
prefix |
str |
Strip env var prefix |
defaults |
dict |
Default values (lowest priority) |
sources |
list[str] |
Custom source order |
env |
str |
Environment name |
Config
| Method | Description |
|---|---|
config.key |
Dot-notation access |
config.get(key, default) |
Safe access with fallback |
config.require(key) |
Throws DotlyteError if missing |
config.to_dict() |
Convert to plain dict |
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dotlyte-0.1.1.tar.gz
(22.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
dotlyte-0.1.1-py3-none-any.whl
(28.0 kB
view details)
File details
Details for the file dotlyte-0.1.1.tar.gz.
File metadata
- Download URL: dotlyte-0.1.1.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc32a57d441488a69aa46a05d1e0c05902b1b4338e2cb5b9b2f8e36ab5c128d1
|
|
| MD5 |
fe5abf4b888fb25a4d63fb6035830b3b
|
|
| BLAKE2b-256 |
4d3612a75cf38df2f948445d0a6abf1a62520db6909b023e7fe61910fe02f468
|
File details
Details for the file dotlyte-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dotlyte-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0363b17fce5068f3441a955573942776e0488fac969643a327125749b5556fd2
|
|
| MD5 |
759a6e6ce14ece202cc2d08bf7a2c3ea
|
|
| BLAKE2b-256 |
0ebcf5b29b8ed147997e2bc2a7254c2ddc460b75879b0a8d83cc8ce44db7cfc1
|