Registry / serialization / sprig-config

sprig-config

JSON →
library1.4.8pypypi✓ verified 80d ago

A Python library for loading and deep-merging configuration from multiple formats (YAML, JSON, TOML, Python dicts) with Spring-like profiles and variable interpolation. Supports include directives and environment variable substitution. Latest version 1.4.8, requires Python ≥3.13.

pip install sprig-config
INSTALL
IMPORT
SIG · SPRIG-CONFIG
S
sprig-config
serializationpythonv1.4.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Config
from sprigconfig import Config
from sprig import Config
load_config
from sprigconfig import load_config
deep_merge
from sprigconfig import deep_merge

Basic usage: create Config instance, load from file, access nested keys.

import os from sprig import Config # Optional: set a profile via environment variable os.environ.setdefault('SPRIG_PROFILE', 'dev') cfg = Config() # Load config from file with profile and variable interpolation cfg.load('config.yml') # Access values using dot notation or dict-like access database_host = cfg.get('database.host', 'localhost') print(database_host)
Debug
Known issues
breakingBreaking: In version 1.0.0, the `load()` method changed from requiring a profile argument to using environment variable 'SPRIG_PROFILE'. Older code passing explicit profile must be updated.
fix
Set SPRIG_PROFILE env var before calling load(), or use new method `load_with_profile()` if available.
affects: >=1.0.0
gotchaGotcha: The package is imported as 'sprig' (underscore), not 'sprig-config' (hyphen). Users often mistakenly do `import sprig_config` or `from sprig-config import ...`.
fix
Use `import sprig` or `from sprig import Config`.
affects: all
deprecatedDeprecated: The `Config.from_dict()` class method is deprecated since v1.2.0. Use `Config().load_dict()` instead.
fix
Replace `Config.from_dict(data)` with `Config().load_dict(data)`.
affects: >=1.2.0
Upgrade
Version history
1.4.8latest on PyPI · released Apr 15, 2026
Audit
Dependencies
pyyamlrequiredYAML file support
tomlirequiredTOML file support
json5requiredJSON5 file support
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
sprig-config — pip install sprig-config · libregistry