Skip to content

project-lighter/sparkwheel

Repository files navigation




CI Coverage PyPI License Documentation

YAML configuration meets Python

Define Python objects in YAML. Reference, compose, and instantiate them effortlessly.


Quick Start

pip install sparkwheel
# config.yaml
dataset:
  num_classes: 10
  batch_size: 32

model:
  _target_: torch.nn.Linear
  in_features: 784
  out_features: "%dataset::num_classes"  # Reference

training:
  steps_per_epoch: "$10000 // @dataset::batch_size"  # Expression
from sparkwheel import Config

config = Config()
config.update("config.yaml")

model = config.resolve("model")  # Actual torch.nn.Linear(784, 10)

Features

  • Declarative Objects - Instantiate any Python class with _target_
  • Smart References - @ for resolved values, % for raw YAML
  • Composition by Default - Dicts merge, lists extend automatically
  • Explicit Control - = to replace, ~ to delete
  • Python Expressions - Dynamic values with $
  • Schema Validation - Type-check with dataclasses

Get Started · Documentation · Quick Reference

Community

About

Sparkwheel is a hard fork of MONAI Bundle's config system, with the goal of making a more general-purpose configuration library for Python projects. It combines the best of MONAI Bundle and Hydra/OmegaConf, while introducing new features and improvements not found in either.

About

Configure your Python workflows with YAML

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •