A package to manage YAML configuration with command line overrides
Project description
YAML Config Manager
A robust, "LLM-friendly" Python library for managing Deep Learning configurations. It seamlessly combines YAML files with command-line overrides, supporting dotted notation, scientific notation, and flexible argument styles.
Features
- YAML + CLI: Load defaults from YAML, override via CLI.
- Dotted Access:
config.model.layer_countinstead ofconfig['model']['layer_count']. - Robust Parsing:
- Supports scientific notation (
1e-4is a float, not string). - Smart boolean parsing (
yes,on,true->True).
- Supports scientific notation (
- Flexible CLI: Supports both
--param=valueand--param value. - Safety: Raises
AttributeErrorfor missing keys (no silent failures).
Installation
pip install .
Quick Start
1. Create config.yaml
training:
lr: 1e-4
batch_size: 32
model:
type: transformer
layers: 12
2. Use in Python
from yaml_config_manager import load_config
# Automatically parses sys.argv
config = load_config()
print(f"Model: {config.model.type}")
print(f"LR: {config.training.lr} (type: {type(config.training.lr)})")
3. Run with Overrides
Mixed styles supported:
python train.py --config config.yaml --training.lr 2e-5 --model.layers=24 --debug_mode
Advanced Usage
- Manual Args:
load_config(args=['--param', 'val']) - Default Path:
load_config(config_path='default.yaml') - Missing Keys: Accessing
config.missingraisesAttributeErrorto catch typos early.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yaml_config_manager-0.2.1.tar.gz.
File metadata
- Download URL: yaml_config_manager-0.2.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
839d9ce42ab8912b8a3afcbd3e138dbf20e2f7977d464b249e0fd695903644a4
|
|
| MD5 |
40d6b98eba6678f7a6c638010ff6a3bb
|
|
| BLAKE2b-256 |
91be61fbfd8fcefa91b4c07e22ecf1ecfda557a7c09b40e608cdcdce13a094e4
|
File details
Details for the file yaml_config_manager-0.2.1-py3-none-any.whl.
File metadata
- Download URL: yaml_config_manager-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02bff06c2ebe755316dfc21552d9c9bd48e1e3e194d0ea4eecf74ab440a04be5
|
|
| MD5 |
1bceabb6ee632e82f37c8ce7e2c2f8a5
|
|
| BLAKE2b-256 |
97ed0b340f814f8359c106fa968059462416ed4eb0f016889f5bc66b4abf78a5
|