{"id":22114030,"url":"https://github.com/plinss/configuration-settings","last_synced_at":"2026-07-27T07:31:14.589Z","repository":{"id":151659802,"uuid":"555629813","full_name":"plinss/configuration-settings","owner":"plinss","description":"General purpose config file parser - Mirror of https://gitlab.linss.com/open-source/python/configuration-settings","archived":false,"fork":false,"pushed_at":"2022-10-22T00:59:41.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T16:47:17.499Z","etag":null,"topics":["python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plinss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-22T00:58:51.000Z","updated_at":"2022-10-22T01:00:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6555691-48fd-4f88-add0-4f50c0cad09c","html_url":"https://github.com/plinss/configuration-settings","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/plinss/configuration-settings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fconfiguration-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fconfiguration-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fconfiguration-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fconfiguration-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plinss","download_url":"https://codeload.github.com/plinss/configuration-settings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fconfiguration-settings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279049858,"owners_count":26093368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python"],"created_at":"2024-12-01T11:08:25.934Z","updated_at":"2025-10-15T04:29:42.332Z","avatar_url":"https://github.com/plinss.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# configuration_settings module\n\nGeneral purpose config file parser.\n\n\n### Installation\n\nInstall with pip:\n\n    pip install configuration-settings\n\n\n### Usage\n\nLoad a set of config files:\n\n    from configuration_settings import Config\n\n    config = Config.load(__file__)\n\nYou may optionally pass a path to a specific config file (generally passed as a command line argument),\nand a dict containing default values.\n\n    def load(cls, script_path: str, config_path: str = None, default: Mapping[str, Any] = None) -\u003e Config:\n\nConfig files may be JSON or YAML, and can contain arbitrary structure.\nDicts in config files are converted to Config objects.\nNames (keys) are case-insensitive.\n\nConfig files are loaded from the following locations:\n\n* If no config path is provided:\n\n  * All parent directories from the location the script is located\n  * The directory the script is located\n  * /etc/{script_name}\n  * The current directory\n\n* If a config path is provided \n\n  * All parent directories from the location the script is located\n  * The directory the script is located\n  * The provided config path\n\nFor each location,\nif the location is a file, load that file, \nthen search the file's directory for directories named: \n'conf.d', 'config.d', '{script_name}.d', '{file_name}.d',\nload all files in those directories in alphabetical order.\nIf the location is a directory, search for files named: \n'config', 'config.local', '{script_name}', '{script_name}.local',\nthen search for subdirectories named:\n'conf.d', 'config.d', '{script_name}.d', '{file_name}.d'.\n\nFiles loaded later override values found in earlier files.\nDict values are merged so only provided keys are replaced.\n\nConfig files may have the following extensions: '.json', '.yml', '.yaml'.\n\nCommon usage would be to have a config file with default values installed in the same location as the main script,\nand then the user would override settings in /etc/{script_name}/config.yaml and /etc/{script_name}/config.d/*.yaml.\n\nConfig objects are dict-like and also allow accessing values as properties.\n\n\nIn addition, there are methods to get values as a specific type:\n\n    def get_int(self, name: str, default: int = None) -\u003e (int | None):\n        \"\"\"\n        Get an item as an int.\n\n        Returns default if missing or not an int.\n        \"\"\"\n\n    def get_float(self, name: str, default: float = None) -\u003e (float | None):\n        \"\"\"\n        Get an item as a float.\n\n        Returns default if missing or not a float.\n        \"\"\"\n\n    def get_bool(self, name: str, default: bool = None) -\u003e (bool | None):\n        \"\"\"\n        Get an item as a bool.\n\n        Returns default if missing or not a bool.\n        \"\"\"\n\n    def get_path(self, name: str, default: str = None) -\u003e (str | None):\n        \"\"\"\n        Get an item as an absolute path.\n\n        Relative paths are resolved to the config file the item was loaded from.\n        Returns default if missing.\n        \"\"\"\n    def get_duration(self, name: str, default: timedelta = None) -\u003e (timedelta | None):\n        \"\"\"\n        Get an item as a timedelta.\n\n        Accepts int values (seconds),\n        or string values with s|m|h|d|w suffix for seconds, minutes, hours, days, or weeks.\n        \"\"\"\n\n\nYou can set a default value for any item via:\n\n    def set_default(self, name: str, value: Any) -\u003e None:\n\n\nYou can retrieve the full set of patsh to config files via the `config_file_paths` property,\nor get the file a specific value was loaded from via:\n\n    def get_config_file_path(self, name: str) -\u003e (str | None):","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinss%2Fconfiguration-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplinss%2Fconfiguration-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinss%2Fconfiguration-settings/lists"}