Metadata-Version: 2.4
Name: dotlyte
Version: 0.1.1
Summary: The universal .env and configuration library. One API for every language.
Project-URL: Homepage, https://github.com/dotlyte-io/dotlyte
Project-URL: Documentation, https://dotlyte.dev
Project-URL: Repository, https://github.com/dotlyte-io/dotlyte/tree/main/langs/python
Project-URL: Issues, https://github.com/dotlyte-io/dotlyte/issues
Project-URL: Changelog, https://github.com/dotlyte-io/dotlyte/blob/main/langs/python/CHANGELOG.md
Author: DOTLYTE Contributors
License-Expression: MIT
Keywords: config,configuration,dotenv,env,environment,toml,yaml
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: pyyaml>=6.0
Requires-Dist: tomli>=2.0; python_version < '3.11'
Provides-Extra: dev
Requires-Dist: cryptography>=42.0; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.9.0; extra == 'dev'
Provides-Extra: encryption
Requires-Dist: cryptography>=42.0; extra == 'encryption'
Description-Content-Type: text/markdown

# dotlyte — Python

The universal `.env` and configuration library for Python.

## Installation

```bash
pip install dotlyte
```

## Quick Start

```python
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
- `.env` file 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

```python
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

[MIT](../../LICENSE)
