Metadata-Version: 2.4
Name: noizu-direnv-config
Version: 0.1.0
Summary: Python SDK for direnv-config (dc) — read and write YAML-backed directory configuration
Keywords: direnv,config,yaml,environment,configuration,dotenv
Author: Keith Brings
Author-email: Keith Brings <keith.brings@noizu.com>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
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-Dist: pyyaml>=6.0
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: ruff ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Python: >=3.9
Project-URL: Homepage, https://github.com/noizu/direnv-config
Project-URL: Repository, https://github.com/noizu/direnv-config
Project-URL: Issues, https://github.com/noizu/direnv-config/issues
Project-URL: Documentation, https://github.com/noizu/direnv-config#readme
Provides-Extra: dev
Description-Content-Type: text/markdown

# noizu-direnv-config

Python SDK for [direnv-config (dc)](https://github.com/noizu/direnv-config) — read and write YAML-backed directory configuration.

## Install

```bash
pip install noizu-direnv-config
```

## Quick Start

```python
from direnv_config import DcClient

# Auto-detect the nearest .dc store
dc = DcClient()

# Read a value
db_host = dc.get("database", "host")
db_port = dc.get_int("database", "port")
debug = dc.get_bool("app", "debug")

# Read an entire config namespace
database_config = dc.get("database")

# Write a value (to the local layer by default)
dc.set("app", "debug", "true")

# Write to a specific layer
dc.set("database", "host", "localhost", layer="local")

# Remove keys
dc.unset("app", ["stale_key", "old_setting"])

# List available config namespaces
configs = dc.list_configs()

# Watch for changes
watcher = dc.watch(lambda version: print(f"config changed: v{version}"))
watcher.start()
# ... later ...
watcher.stop()
```

### Backend Modes

The client supports two backends:

- **`native`** (default) — reads/writes YAML files directly; no external dependencies
- **`cli`** — shells out to the `dc` binary; useful when you need full CLI compatibility

```python
dc = DcClient(mode="cli", dc_binary="/usr/local/bin/dc")
```

## Full Documentation

See the [direnv-config repository](https://github.com/noizu/direnv-config) for full documentation, CLI usage, and configuration format.

## License

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