{"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,"search_vec":"'1.3.6':27 'argument':25 'bestconfig':1,2 'cli':24,38 'configur':10,15,32 'easi':8 'env':36 'env-var':35 'environ':21 'file':20 'json':18,34 'latest':30 'librari':6 'load':14 'manag':11 'project':9 'python':5,19 'releas':31 'support':13 'var':37 'variabl':22 'version':26 'yaml':17,33","created_at":"2026-05-09T05:51:09.948885+00:00","updated_at":"2026-05-09T05:51:09.948885+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/fivol/bestconfig","docs":null,"changelog":null,"pypi":"https://pypi.org/project/bestconfig/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}