{"id":28272,"library":"sprig-config","title":"sprig-config","description":"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.","status":"active","version":"1.4.8","language":"python","source_language":"en","source_url":"https://github.com/derikgw/sprig-config","tags":["configuration","deep-merge","yaml","json","toml","profiles","python"],"install":[{"cmd":"pip install sprig-config","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"YAML file support","package":"pyyaml","optional":false},{"reason":"TOML file support","package":"tomli","optional":false},{"reason":"JSON5 file support","package":"json5","optional":false}],"imports":[{"note":"Package name uses hyphen but import uses underscore; top-level module is 'sprig'","wrong":"from sprig_config import Config","symbol":"Config","correct":"from sprig import Config"},{"note":"Function is 'load_config' in the 'sprig' module","wrong":"from sprig_config import load","symbol":"load_config","correct":"from sprig import load_config"}],"quickstart":{"code":"import os\nfrom sprig import Config\n\n# Optional: set a profile via environment variable\nos.environ.setdefault('SPRIG_PROFILE', 'dev')\n\ncfg = Config()\n# Load config from file with profile and variable interpolation\ncfg.load('config.yml')\n\n# Access values using dot notation or dict-like access\ndatabase_host = cfg.get('database.host', 'localhost')\nprint(database_host)","lang":"python","description":"Basic usage: create Config instance, load from file, access nested keys."},"warnings":[{"fix":"Set SPRIG_PROFILE env var before calling load(), or use new method `load_with_profile()` if available.","message":"Breaking: 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.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use `import sprig` or `from sprig import Config`.","message":"Gotcha: The package is imported as 'sprig' (underscore), not 'sprig-config' (hyphen). Users often mistakenly do `import sprig_config` or `from sprig-config import ...`.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `Config.from_dict(data)` with `Config().load_dict(data)`.","message":"Deprecated: The `Config.from_dict()` class method is deprecated since v1.2.0. Use `Config().load_dict()` instead.","severity":"deprecated","affected_versions":">=1.2.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: import sprig","cause":"Wrong import name. The package is 'sprig-config' but the module is 'sprig'.","error":"ModuleNotFoundError: No module named 'sprig_config'"},{"fix":"Run: pip install sprig-config","cause":"Package not installed or Python environment issue.","error":"ModuleNotFoundError: No module named 'sprig'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}