{"id":16544542,"url":"https://github.com/msoedov/configus","last_synced_at":"2025-10-27T07:13:44.722Z","repository":{"id":74829796,"uuid":"85132577","full_name":"msoedov/configus","owner":"msoedov","description":"Configus - a declarative spec for configuration","archived":false,"fork":false,"pushed_at":"2017-06-29T01:37:13.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T11:17:25.333Z","etag":null,"topics":["config-validation","configuration","configuration-management","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msoedov.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-03-15T23:54:16.000Z","updated_at":"2017-03-15T23:58:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"de35ed3f-5bf3-46ea-b643-e5df37ab8d97","html_url":"https://github.com/msoedov/configus","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"72510b2f771c2f8efd732f381d133dd3ba3197d1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Fconfigus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Fconfigus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Fconfigus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Fconfigus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msoedov","download_url":"https://codeload.github.com/msoedov/configus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801255,"owners_count":20022390,"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","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":["config-validation","configuration","configuration-management","python"],"created_at":"2024-10-11T19:03:09.972Z","updated_at":"2025-10-27T07:13:39.664Z","avatar_url":"https://github.com/msoedov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Configus - a declarative contract for configuration\n\n\n### Instalation\n\n```\npip install configus\n```\n\n### Features\n\n- [x] Unified spec for process config\n- [x] Strict validation of config, no more trailing whitespaces or runtime panics from malphormed uri's\n\n- [x] Support parametrization from env variables and cli arguments at the same time.\n    - [x] The same param could passed as `export DEBUG=on` or `--debug=on`\n- [x] Auto load of `.env` file\n- [x] Easy to mock for unit tests\n\n### Usage\n\nLet start with a simple spec that our requires `debug`, `version` and `secret_cookie` configuration params\n\n```python\n# app.py\nfrom configus import config, trafaret as t\n\nif __name__ == '__main__':\n    # Describes shape of the data params which will be taken either from env, cli args or envfile.\n    schema = t.Dict(DEBUG=t.StrBool, VERSION=t.Float, SECRET_COOKIE=t.String)\n    env_vars = config(schema=schema)\n    assert env_vars == {'DEBUG': True, VERSION: 0.1, SECRET_COOKIE=\u003c......\u003e}\n```\n\nOnce schema defined we can pass variables throw env\n\n```shell\nDEBUG=1 VERSION=1.0 SECRET_COOKIE=yo python app.py\n```\n\nCmd flags\n```shell\npython app.py --debug=1 version=1.0\n```\n\nOr even both\n\n```shell\nexport VERSION=1.0\nexport SECRET_COOKIE=yo\npython app.py --debug=2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsoedov%2Fconfigus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsoedov%2Fconfigus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsoedov%2Fconfigus/lists"}