Easy Yaml based Configuration for Python
- 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
You can install EYConf from PyPI using pip.
pip install eyconffrom 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) # FalseThis will create a config.yaml file in your current working directory with the following content:
# Application configuration
database_url: sqlite:///app.db
debug: falsePlease refer to the documentation for more examples and detailed usage instructions.