https://github.com/semohr/eyconf
Easy Configuration with yaml and dataclasses
https://github.com/semohr/eyconf
config validation yaml
Last synced: 5 months ago
JSON representation
Easy Configuration with yaml and dataclasses
- Host: GitHub
- URL: https://github.com/semohr/eyconf
- Owner: semohr
- License: gpl-3.0
- Created: 2025-01-29T18:12:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-26T18:08:53.000Z (5 months ago)
- Last Synced: 2026-01-27T01:19:55.898Z (5 months ago)
- Topics: config, validation, yaml
- Language: Python
- Homepage:
- Size: 430 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
EYConf
Easy Yaml based Configuration for Python
## Why EYConf?
- **Schema-First Configuration**: Define your config structure with Python dataclasses, get automatic YAML generation with comments
- **Type-Safe Access**: Access nested configuration values with full IDE support and runtime type checking
- **Validation First**: Catch configuration errors early with detailed, human-readable validation messages
- **Zero Boilerplate**: No manual YAML parsing, no dictionary access - just clean attribute access to your configuration
## Installation
You can install EYConf from [PyPI](https://pypi.org/project/eyconf/) using pip.
```bash
pip install eyconf
```
## Example Usage
```python
from dataclasses import dataclass
from eyconf import EYConf
@dataclass
class AppConfig:
"""Application configuration"""
database_url: str = "sqlite:///app.db"
debug: bool = False
# Creates/loads config.yaml automatically
config = EYConf(AppConfig)
# Use your config
print(config.data.debug) # False
```
This will create a `config.yaml` file in your current working directory with the following content:
```yaml
# Application configuration
database_url: sqlite:///app.db
debug: false
```
Please refer to the [documentation](https://eyconf.readthedocs.io/en/latest/) for more examples and detailed usage instructions.