Skip to main content

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


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.2.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyzyconfig-0.0.2-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

Details for the file pyzyconfig-0.0.2.tar.gz.

File metadata

  • Download URL: pyzyconfig-0.0.2.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pyzyconfig-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1fb05377211d978a4296386f311752e18a2e3915432e013a75cb5fd00d06f7c4
MD5 8eb7908570c3229c3a6d81de2cf3df2c
BLAKE2b-256 7db2d441771af0498bad405e0b13b6f952586f0937b4fecd523168d41b3f0eb2

See more details on using hashes here.

File details

Details for the file pyzyconfig-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyzyconfig-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 1.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pyzyconfig-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5632bd9e13faf7e04628c1488b89d0e819d8b41033a00950b1e8c59753145839
MD5 f29b256960d5eb0cc2fc2911487b5a81
BLAKE2b-256 546aadcfbdb6d68bebf38adb30ae2ea23b2a03521b3f11ee5c404a986babf1d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page