Spring Boot-style configuration for Python applications
SprigConfig is built on a set of guiding principles that inform every design decision. Understanding these principles helps you use the library effectively and predict its behavior.
What your configuration does matters more than how it’s written. SprigConfig focuses on predictable, deterministic behavior regardless of whether you use YAML, JSON, or TOML.
The merge algorithm, import resolution, and secret handling work identically across all formats. Parsing is treated as a leaf concern—a detail that shouldn’t affect configuration semantics.
SprigConfig separates configuration behavior (merging, profiles, imports) from file parsing. This means:
Every 1.x release maintains backward compatibility with previous 1.x releases. Existing projects continue to work without changes. Breaking changes are reserved for 2.0.
A major version bump happens only when public APIs or documented behavior must change. We avoid version inflation—2.0 means something significant changed.
Configuration behavior should be obvious from looking at the files. SprigConfig avoids magic that makes configuration hard to understand.
imports: listGiven the same inputs, SprigConfig always produces the same output. There are no race conditions, random behaviors, or order-dependent surprises.
Every configuration value should be traceable to its source. SprigConfig injects metadata that tells you:
This makes debugging configuration issues straightforward—you can see exactly where each value came from.
When something goes wrong in production, you need to understand your configuration quickly. SprigConfig is designed to make this easy:
SprigConfig is intentionally focused. It does not:
This focus allows SprigConfig to do its core job exceptionally well.
SprigConfig supports formats that natively express hierarchical configuration:
| Format | Supported | Reason |
|---|---|---|
| YAML | Yes | Native hierarchy, comments, readability |
| JSON | Yes | Strict, portable, tooling support |
| TOML | Yes | Modern, stdlib support in Python 3.11+ |
| INI | No | Flat format requiring invented semantics |
| Properties | No | Flat format requiring dot-splitting |
Flat formats are not supported because they would require inventing behavior for:
This invented behavior would violate the principle that configuration behavior should be explicit and predictable.
When contributing to SprigConfig, keep these principles in mind:
See CONTRIBUTING.md for detailed guidelines.