{"id":41053188,"url":"https://github.com/jaesivsm/the_conf","last_synced_at":"2026-01-22T11:30:08.296Z","repository":{"id":45948138,"uuid":"98647163","full_name":"jaesivsm/the_conf","owner":"jaesivsm","description":"Module for handling configuration from multiple sources.","archived":false,"fork":false,"pushed_at":"2026-01-12T22:33:30.000Z","size":259,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T02:46:59.243Z","etag":null,"topics":["cmdline","conf","configuration","environ","json","python","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaesivsm.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-07-28T12:23:59.000Z","updated_at":"2026-01-12T22:33:33.000Z","dependencies_parsed_at":"2024-12-29T23:22:04.193Z","dependency_job_id":"6bf95db9-334b-4c5b-be67-8e688506b6a3","html_url":"https://github.com/jaesivsm/the_conf","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":0.2666666666666667,"last_synced_commit":"abbd1f9da8c5acbf2117c0fd40ef4bba9f456147"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/jaesivsm/the_conf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaesivsm%2Fthe_conf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaesivsm%2Fthe_conf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaesivsm%2Fthe_conf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaesivsm%2Fthe_conf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaesivsm","download_url":"https://codeload.github.com/jaesivsm/the_conf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaesivsm%2Fthe_conf/sbom","scorecard":{"id":501965,"data":{"date":"2025-08-11","repo":{"name":"github.com/jaesivsm/the_conf","commit":"2a200e8a046e0bc62096b654e28bf143db6dddba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v2.1: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-48p4-8xcf-vxj5","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T22:09:06.271Z","repository_id":45948138,"created_at":"2025-08-19T22:09:06.271Z","updated_at":"2025-08-19T22:09:06.271Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28662082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["cmdline","conf","configuration","environ","json","python","yaml"],"created_at":"2026-01-22T11:30:08.108Z","updated_at":"2026-01-22T11:30:08.283Z","avatar_url":"https://github.com/jaesivsm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# the_conf\n\n[![Build Status](https://travis-ci.org/jaesivsm/the_conf.svg?branch=master)](https://travis-ci.org/jaesivsm/the_conf) [![Coverage Status](https://coveralls.io/repos/github/jaesivsm/the_conf/badge.svg?branch=master)](https://coveralls.io/github/jaesivsm/the_conf?branch=master)\n\nA Python configuration management library that merges values from multiple sources (files, command line, environment variables) with schema validation and configurable priority ordering.\n\n## Installation\n\n```bash\npip install the_conf\n# or\npoetry add the_conf\n```\n\n## Quick Start\n\n### 1. Define a Meta Configuration (Schema)\n\nCreate a YAML file defining your configuration schema (`myapp.meta.yml`):\n\n```yaml\nsource_order: ['env', 'files', 'cmd']  # Priority order (first wins)\nconfig_files: ['config.yml']\n\nparameters:\n  - database_url:\n      type: str\n      required: true\n      help_txt: Database connection string\n  - debug:\n      type: bool\n      default: false\n  - max_connections:\n      type: int\n      default: 10\n      among: [5, 10, 20, 50]  # Valid choices\n  - nested:\n    - timeout:\n        type: int\n        default: 30\n```\n\n### 2. Load Configuration\n\n```python\nfrom the_conf import TheConf\n\n# Load meta configuration and gather values from all sources\nconf = TheConf('myapp.meta.yml')\n\n# Access values\nprint(conf.database_url)\nprint(conf.debug)\nprint(conf.nested.timeout)\n\n# Modify values (writes to main config file)\nconf.max_connections = 20\nconf.write()\n```\n\n### 3. Provide Values from Different Sources\n\n**From environment variables:**\n```bash\nexport DATABASE_URL=\"postgresql://localhost/mydb\"\nexport NESTED_TIMEOUT=\"60\"\n```\n\n**From config file** (`config.yml`):\n```yaml\ndatabase_url: postgresql://localhost/mydb\ndebug: true\nnested:\n  timeout: 45\n```\n\n**From command line:**\n```bash\npython myapp.py --database-url postgresql://localhost/mydb --debug --nested-timeout 60\n```\n\n## Source Priority System\n\nThe `source_order` defines which source takes precedence when the same parameter is provided from multiple sources. **The first source in the list wins** - later sources do not overwrite values from earlier sources.\n\n**Default order:** `[\"cmd\", \"files\", \"env\"]` (command line \u003e files \u003e environment)\n\n**Example with `source_order: [\"env\", \"files\", \"cmd\"]`:**\n- If `DEBUG` is set in environment variables, the value from config files or command line will be **ignored**\n- This is useful when you want environment variables (e.g., in containers) to always take precedence\n\n## Parameter Options\n\n- `type`: `str`, `int`, `bool`, `list`, `dict`\n- `default`: Default value (cannot be combined with `required`)\n- `required`: Must be provided from at least one source\n- `among`: List of valid choices\n- `read_only`: Prevents modification after initial load\n- `no_cmd`: Exclude this parameter from command line parsing\n- `no_env`: Exclude this parameter from environment variable parsing\n- `cmd_line_opt`: Override the auto-generated command line flag\n- `help_txt`: Help text for documentation and CLI\n\n## List Parameters\n\n### Simple Lists\n\n```yaml\nparameters:\n  - allowed_ips:\n      type: list\n      allowed_ips: {type: str}\n```\n\n**From environment:**\n```bash\nexport ALLOWED_IPS_0=\"192.168.1.1\"\nexport ALLOWED_IPS_1=\"192.168.1.2\"\n```\n\n**From file:**\n```yaml\nallowed_ips:\n  - 192.168.1.1\n  - 192.168.1.2\n```\n\n**In Python:**\n```python\nconf.allowed_ips.append(\"192.168.1.3\")\nprint(conf.allowed_ips[0])  # 192.168.1.1\n```\n\n### Complex Lists (Lists of Dicts)\n\n```yaml\nparameters:\n  - servers:\n      type: list\n      servers:\n        - host: {type: str}\n        - port: {type: int}\n```\n\n**From environment:**\n```bash\nexport SERVERS_0_HOST=\"localhost\"\nexport SERVERS_0_PORT=\"8080\"\nexport SERVERS_1_HOST=\"remote.host\"\nexport SERVERS_1_PORT=\"8081\"\n```\n\n**From file:**\n```yaml\nservers:\n  - host: localhost\n    port: 8080\n  - host: remote.host\n    port: 8081\n```\n\n**In Python:**\n```python\nprint(conf.servers[0].host)  # localhost\nprint(conf.servers[0].port)  # 8080\n```\n\n**Note:** List parameters are not available via command line arguments due to technical limitations.\n\n## File Encryption\n\n`the_conf` supports encrypted configuration files using AES encryption:\n\n```python\n# Save encrypted config\nconf = TheConf('myapp.meta.yml')\nconf.database_password = \"secret\"\nconf.write('config.yml', passkey='my-encryption-key')\n\n# Load encrypted config\nconf = TheConf('myapp.meta.yml', passkey='my-encryption-key')\n```\n\nOr via command line/environment:\n```bash\npython myapp.py --passkey my-encryption-key\n# or\nexport THECONF_PASSKEY=\"my-encryption-key\"\n```\n\n## Nested Configuration\n\nCreate hierarchical configuration structures:\n\n```yaml\nparameters:\n  - database:\n    - host: {type: str, default: localhost}\n    - port: {type: int, default: 5432}\n    - credentials:\n      - username: {type: str}\n      - password: {type: str}\n```\n\nAccess with dot notation:\n```python\nconf.database.host\nconf.database.credentials.username\n```\n\n## Interactive Configuration Generation\n\nUse the interactive mode to generate configuration files:\n\n```python\nconf = TheConf('myapp.meta.yml', prompt_values=True)\n# Prompts user for required values and generates config file\n```\n\n## Design Philosophy\n\nFrom [this article](http://sametmax.com/les-plus-grosses-roues-du-monde/), a good configuration library should:\n\n- Provide a standardized API to define parameters via a data schema\n- Generate command line and environment variable parsers from the schema\n- Generate validators from the schema\n- Separate program configuration from user parameters\n- Support read-only settings and permissions\n- Load settings from compatible sources (database, files, APIs, services)\n- Support configuration hierarchies with cascading value retrieval\n- Be simple enough for small scripts yet powerful for complex applications\n- Auto-document settings\n\n## Terminology\n\n- **Meta Configuration**: The schema file (YAML/JSON) that defines parameter names, types, defaults, and validators\n- **User Configuration**: The actual values loaded from files, command line, or environment variables\n\n## Development\n\n```bash\n# Run tests\nmake test\n\n# Run linters\nmake lint\n\n# Build package\nmake build\n```\n\n## License\n\nGPLv3 - See LICENSE file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaesivsm%2Fthe_conf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaesivsm%2Fthe_conf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaesivsm%2Fthe_conf/lists"}