{"id":27612,"library":"bestconfig","title":"BestConfig","description":"BestConfig is a Python library for easy project configuration management. It supports loading configuration from YAML, JSON, Python files, environment variables, and CLI arguments. Version 1.3.6 is the latest release.","status":"active","version":"1.3.6","language":"python","source_language":"en","source_url":"https://github.com/fivol/bestconfig","tags":["configuration","yaml","json","env-vars","cli"],"install":[{"cmd":"pip install bestconfig","lang":"bash","label":"pip install bestconfig"}],"dependencies":[{"reason":"Used for YAML configuration file support","package":"pyyaml","optional":true},{"reason":"Used for JSON logging integration","package":"python-json-logger","optional":true}],"imports":[{"note":"The main class is Config with capital C, not lowercase config","wrong":"from bestconfig import config","symbol":"Config","correct":"from bestconfig import Config"}],"quickstart":{"code":"from bestconfig import Config\n\nconfig = Config()\nprint(config.get('key', default='default_value'))\nprint(config.key)","lang":"python","description":"Create a Config object; automatically loads from config.yml, config.json, environment variables, and CLI args."},"warnings":[{"fix":"Use config.get('missing_key', default='fallback') instead of config.missing_key","message":"Config raises KeyError if accessing a missing key with attribute syntax. Use .get() with a default to avoid exceptions.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace config.get_config('key') with config.key or config.get('key')","message":"The method Config.get_config() is deprecated in favor of direct attribute access or .get().","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Set Config(env_prefix='MYAPP_') to only load variables starting with 'MYAPP_'","message":"Environment variable overrides: Prefix env vars with your app name to avoid conflicts. By default, all env vars are loaded.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use config.get('key', default) or check with 'key' in config","cause":"Trying to access a config key that does not exist using attribute syntax.","error":"KeyError: 'key'"},{"fix":"Ensure the key exists in your config files or use .get() to avoid AttributeError","cause":"Typo or key not loaded (e.g., file not found or env var missing).","error":"AttributeError: 'Config' object has no attribute 'some_key'"},{"fix":"Create a config.yml or pass a custom path to Config(file='my_config.yml')","cause":"Default config file is missing. BestConfig looks for config.yml, config.json, etc.","error":"FileNotFoundError: [Errno 2] No such file 'config.yml'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}