Skip to main content

A powerful YAML-based configuration system with references, expressions, and dynamic instantiation

Project description

Tests Code quality PyPI Documentation License

Define your workflow in YAML, instantiate it in Python


Installation

pip install sparkwheel

Requirements: Python 3.10+

Quick Start

Define your workflow in YAML, then use it in Python. Objects are created with their dependencies automatically resolved.

config.yaml

network:
  _target_: torch.nn.Linear
  in_features: 784
  out_features: 10

optimizer:
  _target_: torch.optim.Adam
  params: $@network.parameters()
  lr: 0.001

main.py

from sparkwheel import ConfigParser

parser = ConfigParser()
parser.read_config("config.yaml")

network = parser.get_parsed_content("network")
optimizer = parser.get_parsed_content("optimizer")

Features

  • Declarative: Build complex applications using simple YAML configs
  • References: Link configuration values with @ for resolved Python objects or % for raw YAML values
  • Composition: Combine multiple configuration files seamlessly
  • Expressions: Execute Python code within configs using $ prefix

Usage

📚 Documentation →

About

Sparkwheel is a hard fork of MONAI's configuration system, stripped down to focus and improve its usability for general purposes. We're deeply grateful to the MONAI team for their excellent foundation.

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

sparkwheel-0.0.2.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

sparkwheel-0.0.2-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sparkwheel-0.0.2.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for sparkwheel-0.0.2.tar.gz
Algorithm Hash digest
SHA256 51bdb68739988cb145621d078ef9cc2aa7a22be916ff57be3cb9d754c3f576ad
MD5 82eaf04e9b64165e40800fc49b35e9ae
BLAKE2b-256 558edf135fb8407f3dab1c8946ddbcc29dbb2acc6069583bd3ca7ffb71cc4bbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparkwheel-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eddcb18964f9d32c6c8cd94469e2ac9ae6dfe1a72d6465cd2ecd823494ab5ba9
MD5 f1cb8c7a2fbbf04b10ce7d61d4e21348
BLAKE2b-256 2ae14d10936281fd427d62fa3db3581ae81174a04abecd745324db684df8c69d

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