π§ ConfigFlowο
ConfigFlow is a Python library for managing configuration files with real-time monitoring and event-driven updates.
Supports JSON, YAML, and more β with validation and a simple API.
β¨ Featuresο
Unified Parsing: Load JSON, YAML, and other formats.
Real-Time Monitoring: Detect config changes instantly using
watchdog.Event-Driven: Register callbacks for config updates.
Validation: Ensure configs match your schema with
pydantic.
π¦ Installationο
pip install configflow
β‘ Quickstartο
from configflow import ConfigFlow
# Initialize with a config file
config = ConfigFlow("settings.yaml")
# Define a schema
schema = {"port": int, "debug": bool}
# Register a callback
@config.on_change
def handle_update(changed_config):
print(f"Config updated: {changed_config}")
# Load and watch
config.load(schema=schema)
config.watch()
# Keep running (Ctrl+C to stop)
try:
while True:
pass
except KeyboardInterrupt:
config.stop()
π Example Config (settings.yaml)ο
port: 8080
debug: true
π Documentationο
Full documentation is available at ConfigFlow Docs.
(Replace # with your actual docs link once published.)
π€ Contributingο
We welcome contributions!
See CONTRIBUTING.md for guidelines on adding new features, bug fixes, or parser support.
π Licenseο
MIT License