Easy experiment configuration saver for ML projects
Project description
Experiment Config Saver
Automatically save all your experiment constants to JSON for reproducibility.
Usage
Simple usage
from pyzyconfig import save_config_to_json
# Your experiment constants
RUN_NAME = "my_experiment"
BATCH_SIZE = 32
LEARNING_RATE = 0.001
EPOCHS = 100
# Save all UPPERCASE variables
save_config_to_json("./outputs")
With exclusions
from pyzyconfig import save_config_to_json
DEVICE = "cuda" # Don't want to save this
RUN_NAME = "my_experiment"
BATCH_SIZE = 32
# Exclude DEVICE from being saved
save_config_to_json("./outputs", exclude=['DEVICE'])
Class-based usage
from pyzyconfig import ConfigSaver
saver = ConfigSaver(exclude=['DEVICE', 'DEBUG'])
saver.save("./outputs")
Load config
from exp_config_saver import load_config_from_json
config = load_config_from_json("./outputs/config.json")
print(config['BATCH_SIZE']) # 32
Output example
{
"BATCH_SIZE": 32,
"EPOCHS": 100,
"LEARNING_RATE": 0.001,
"RUN_NAME": "my_experiment",
"_config_version": "0.1.0",
"_saved_at": "2025-12-03T15:30:45.123456"
}
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
pyzyconfig-0.0.3.tar.gz
(3.5 kB
view details)
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 pyzyconfig-0.0.3.tar.gz.
File metadata
- Download URL: pyzyconfig-0.0.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90a6198ef9905efd74c0cde15b62160f0d6b28e66c7cb283a80499cc0e3cd888
|
|
| MD5 |
16c54f603e2dd17b0c841284cc258e44
|
|
| BLAKE2b-256 |
28a132fb372e3a3ffa38625885f22a4d8437184a9a1e1d4224790f5fc6d6ff82
|
File details
Details for the file pyzyconfig-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pyzyconfig-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06345a5fa43945f044316bf6854f8af33bbfb5ff6c557afa52231753e76556a7
|
|
| MD5 |
55c06356cb7efbb7b90d001b94232b01
|
|
| BLAKE2b-256 |
7e5d2e65fdb02071ea49b4555a637e14e15a724b153227253176610bbe8e740f
|