{"id":49688338,"url":"https://github.com/permitio/configence","last_synced_at":"2026-05-07T11:09:12.266Z","repository":{"id":303246321,"uuid":"1014835338","full_name":"permitio/configence","owner":"permitio","description":"Easy Python configuration interface built on top of python-decouple and click / typer. Adding typing support and parsing with Pydantic and Enum. Combine config values from .env, .ini, env-vars, and cli options (Override order: .env \u003c .ini \u003c env-vars \u003c cli)","archived":false,"fork":false,"pushed_at":"2025-07-06T14:50:53.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-03T19:41:06.139Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/permitio.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,"zenodo":null}},"created_at":"2025-07-06T14:05:01.000Z","updated_at":"2025-07-06T14:50:57.000Z","dependencies_parsed_at":"2025-07-06T15:43:12.826Z","dependency_job_id":"96e7b767-859c-40d7-a274-61535f78047f","html_url":"https://github.com/permitio/configence","commit_stats":null,"previous_names":["permitio/configence"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/permitio/configence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fconfigence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fconfigence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fconfigence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fconfigence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permitio","download_url":"https://codeload.github.com/permitio/configence/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fconfigence/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32734474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-05-07T11:09:08.053Z","updated_at":"2026-05-07T11:09:12.250Z","avatar_url":"https://github.com/permitio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configence\n\nEasy Python configuration interface built on top of python-decouple and click / typer.\nAdding typing support and parsing with Pydantic and Enum.\nCombine config values from .env, .ini, env-vars, and cli options\n(Override order: .env \u003c .ini \u003c env-vars \u003c cli)\n\n\n## Simple config values\n\n\n```python\nfrom configence import Configence\n\n# init confi as simple parser (Without model class)\nconfigence = Configence(is_model=False)\n\n# parse a string value from env-var, or '.env' '.ini' files\n# MY_HERO will contain a string read from env, or the default - 'Son Goku'\nMY_HERO = configence.str(\"MY_HERO\", 'Son Goku')\n\n# parse an int\nPOWER_LEVEL = configence.int(\"POWER_LEVEL\", 9001, description=\"The scouter power reading\")\n\n# parse a pydantic model\n# you can pass a valid JSON to the envvar\n\n# define model\nfrom pydantic import BaseModel\nclass MyPydantic(BaseModel):\n    entries: List[int] = Field(..., description=\"list of integers\")\n    name: str\n# parse the model from JSON passed to env-var (or default)\nJSON = configence.model(\n    \"JSON\",\n    MyPydantic,\n    {\n        \"entries\":[ 1,3,43,5,7],\n        \"name\": \"Moses\"\n    }\n)\n```\n### Add prefix to env vars\n```python\nfrom configence import Configence\n\n# init confi as simple parser (Without model class)\n# And with Prefix\nconfigence = Configence(prefix=\"NEW_\" is_model=False)\n\n# parse a string value from env-var, or '.env' '.ini' files\n# instead of loading the envar MY_HERO - will read from NEW_MY_HERO (due to prefix)\nMY_HERO = configence.str(\"MY_HERO\", 'Son Goku')\n```\n\n## Configence models\nFor more advanced parsing (e.g delayed loading), separating into groups, configence use configence models  (classes that derive from Configence and have value members)\nThe values are only loaded when the class is initialized.\n\n```python\nfrom configence import Configence, configence\n\nclass MyModel(Configence):\n    # parse values\n    MY_HERO = configence.str(\"MY_HERO\", 'Son Goku')\n    POWER_LEVEL = configence.int(\"POWER_LEVEL\", 9001)\n    # mix in real consts\n    MY_CONST = \"Bulma!\"\n\n# get the parsed values into an object\n# can also apply prefix here\nmy_config = MyModel()\n```\n\n### Delayed loading\nWhen you have config values that depend on one another; you can use `configence.delay()` to make sure they are loaded in when their dependencies are parsed.\nDelayed values are loaded in the order they are written (e.g. higher lines first)\nDelayed values can be default-value strings, default-value functions, or whole configence-entries\n\n```python\nclass MyModel(Configence):\n    MY_HERO = configence.str(\"MY_HERO\", 'Son Goku')\n    POWER_LEVEL = configence.int(\"POWER_LEVEL\", 9001)\n    # delay loaded default-value string\n    SHOUT = configence.delay(\"{MY_HERO} is over {POWER_LEVEL}\")\n    # delay loaded default-value function\n    EVENTS = configence.list(\"EVENTS\", configence.delay(lambda MY_HERO=\"\", SHOUT=\"\": [MY_HERO, SHOUT]) )\n    # delay loaded whole entry\n    HAS_LONG_SHOUT = configence.delay(lambda SHOUT=\"\":\n        configence.bool(\"HAS_LONG_SHOUT\", len(SHOUT) \u003e 12 )\n    )\n```\n## Configence cli parsing\non-top of envars you can also use command line\n```python\n# will trigger a command line interface\nMyModel.cli()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermitio%2Fconfigence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermitio%2Fconfigence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermitio%2Fconfigence/lists"}