{"id":24827905,"url":"https://github.com/onjin/runenv","last_synced_at":"2025-10-14T01:30:56.543Z","repository":{"id":32992849,"uuid":"36621670","full_name":"onjin/runenv","owner":"onjin","description":"Wrapper to run programs with different env","archived":false,"fork":false,"pushed_at":"2025-06-19T04:41:24.000Z","size":203,"stargazers_count":4,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-29T12:27:17.409Z","etag":null,"topics":["django","environment-variables","flask","python","twelve-factor"],"latest_commit_sha":null,"homepage":"https://runenv.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"GitbookIO/gitbook-cli","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onjin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-05-31T20:54:04.000Z","updated_at":"2025-06-06T16:50:25.000Z","dependencies_parsed_at":"2025-01-04T00:18:30.916Z","dependency_job_id":"940c73b8-7e83-4b4e-b588-b9eb2bf7eb22","html_url":"https://github.com/onjin/runenv","commit_stats":{"total_commits":38,"total_committers":2,"mean_commits":19.0,"dds":0.02631578947368418,"last_synced_commit":"b43a6eb96ab2643fb845a8a004d218494b7b8cdb"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/onjin/runenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onjin%2Frunenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onjin%2Frunenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onjin%2Frunenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onjin%2Frunenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onjin","download_url":"https://codeload.github.com/onjin/runenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onjin%2Frunenv/sbom","scorecard":{"id":707415,"data":{"date":"2025-08-11","repo":{"name":"github.com/onjin/runenv","commit":"957489089320d4569f9e73170ddfcd75144777ff"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/24 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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"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":7,"reason":"8 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":6,"reason":"dependency not pinned by hash detected -- score normalized to 6","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/onjin/runenv/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/onjin/runenv/test.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned"],"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":"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":"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: MIT License: 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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 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"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","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"}}]},"last_synced_at":"2025-08-22T07:05:04.340Z","repository_id":32992849,"created_at":"2025-08-22T07:05:04.341Z","updated_at":"2025-08-22T07:05:04.341Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017492,"owners_count":26086083,"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-13T02:00:06.723Z","response_time":61,"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":["django","environment-variables","flask","python","twelve-factor"],"created_at":"2025-01-30T22:23:13.642Z","updated_at":"2025-10-14T01:30:56.537Z","avatar_url":"https://github.com/onjin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# runenv\n\nManage application settings with ease using `runenv`, a lightweight tool inspired by [The Twelve-Factor App](https://12factor.net/config) methodology for configuration through environment variables.\n\n`runenv` provides:\n- A CLI for language-agnostic `.env` profile execution\n- A Python API for programmatic `.env` loading\n\n\u003e “Store config in the environment” — [12factor.net/config](https://12factor.net/config)\n\n| Section  | Status |\n|----------|--------|\n| CI/CD    | [![CI - Test](https://github.com/onjin/runenv/actions/workflows/test.yml/badge.svg)](https://github.com/onjin/runenv/actions/workflows/test.yml) |\n| PyPI     | [![PyPI - Version](https://img.shields.io/pypi/v/runenv.svg?logo=pypi\u0026label=PyPI)](https://pypi.org/project/runenv/) [![Downloads](https://img.shields.io/pypi/dm/runenv.svg?color=blue)](https://pypi.org/project/runenv/) |\n| Python   | [![Python Versions](https://img.shields.io/pypi/pyversions/runenv.svg?logo=python\u0026label=Python)](https://pypi.org/project/runenv/) |\n| Style    | [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Mypy](https://img.shields.io/badge/types-Mypy-blue.svg)](https://github.com/python/mypy) |\n| License  | [![License - MIT](https://img.shields.io/badge/license-MIT-9400d3.svg)](https://spdx.org/licenses/) |\n| Docs     | [CHANGELOG.md](CHANGELOG.md) |\n\n---\n\n## Table of Contents\n\n- [Key Features](#key-features)\n- [Quick Start](#quick-start)\n  - [Installation](#installation)\n  - [CLI Usage](#cli-usage)\n  - [Python API](#python-api)\n- [Multiple Profiles](#multiple-profiles)\n- [Framework Integrations](#framework-integrations)\n- [Sample `.env` File](#sample-env-file)\n- [Similar Tools](#similar-tools)\n\n---\n\n## Key Features\n\n- 🚀 **CLI-First**: Use `.env` files across any language or platform.\n- 🐍 **Python-native API**: Load and transform environment settings inside Python.\n- ⚙️ **Multiple Profiles**: Switch easily between `.env.dev`, `.env.prod`, etc.\n- ⚙️ **Multiple Formats**: Use plain `.env`, `.env.json`, `.env.toml`, or `.env.yaml`\n- ⚙️ **Autodetect Env File**: Looking for `.env`, `.env.json`, `.env.toml`, and `.env.yaml`\n- 🧩 **Framework-Friendly**: Works well with Django, Flask, FastAPI, and more.\n\n---\n\n## Quick Start\n\n### Installation\n\n```bash\npip install runenv\npip install runenv[toml] # if you want to use .env.toml in python \u003c 3.11\npip install runenv[yaml] # if you want to use .env.yaml\n```\n\n### CLI Usage\n\nRun any command with a specified environment:\n\n```bash\nrunenv run --env-file .env.dev -- python manage.py runserver\nrunenv run --env-file .env.prod -- uvicorn app:app --host 0.0.0.0\nrunenv list [--env-file .env] # view parsed variables\nrunenv lint [--env-file .env] # check common errors in env file\n```\n\n---\n\n## Python API\n\n### Load `.env` into `os.environ`\n\n\u003e **Note**: The `load_env` will not parse env_file if the `runenv` CLI was used, unless you `force=True` it.\n\n```python\nfrom runenv import load_env\n\nload_env() # loads .env\nload_env(\n    env_file=\".env.dev\",    # file to load - will be autodetected if not passed\n    prefix='APP_',          # load only APP_.* variables from file\n    strip_prefix=True,      # strip ^ prefix when loading variables\n    force=True,             # load env_file even if the `runvenv` CLI was used\n    search_parent=1,        # look for env_file in current dir and its 1 parent dirs\n    require_env_file=False  # raise error if env file is missing, otherwise just ignore\n)\n```\n\n### Read `.env` as a dictionary\n\n```python\nfrom runenv import create_env\n\nconfig = create_env() # parse .env content into dictionary\nconfig = create_env(\n    env_file=\".env.dev\",    # file to load - will be autodetected if not passed\n    prefix='APP_',          # parse only APP_.* variables from file\n    strip_prefix=True,      # strip ^ prefix when parsing variables\n    search_parent=1,        # look for env_file in current dir and its 1 parent dirs\n)\nprint(config)\n```\n\nOptions include:\n- Filtering by prefix\n- Automatic prefix stripping\n- Searching parent directories\n\n---\n\n## Multiple Profiles\n\nUse separate `.env` files per environment:\n\n```bash\nrunenv .env.dev flask run\nrunenv .env.staging python main.py\nrunenv .env.production uvicorn app.main:app\n```\n\nRecommended structure:\n```\n.env.dev\n.env.test\n.env.staging\n.env.production\n```\n\n---\n\n## Framework Integrations\n\n\u003e **Note**: If you're using `runenv .env [./manage.py, ...]` CLI then you do not need change your code. Use these integrations only if you're using Python API.\n\n### Django\n\n```python\n# manage.py or wsgi.py\nfrom runenv import load_env\nload_env(\".env\")\n```\n\n### Flask\n\n```python\nfrom flask import Flask\nfrom runenv import load_env\n\nload_env(\".env\")\napp = Flask(__name__)\n```\n\n### FastAPI\n\n```python\nfrom fastapi import FastAPI\nfrom runenv import load_env\n\nload_env(\".env\")\napp = FastAPI()\n```\n\n---\n\n## Sample `.env` File\n\n```ini\n# Basic\nDEBUG=1\nPORT=8000\n\n# Nested variable\nHOST=localhost\nURL=http://${HOST}:${PORT}\n\n# Quotes and comments\nEMAIL=\"admin@example.com\" # Inline comment\nSECRET='s3cr3t'\n```\n\n---\n\n## Similar Tools\n\n- [python-dotenv](https://github.com/theskumar/python-dotenv) – Python-focused, lacks CLI tool\n- [envdir](https://github.com/jezdez/envdir) – Directory-based env manager\n- [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) – Linter for `.env` files\n\n---\n\nWith `runenv`, you get portable, scalable, and explicit configuration management that aligns with modern deployment standards. Ideal for CLI usage, Python projects, and multi-environment pipelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonjin%2Frunenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonjin%2Frunenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonjin%2Frunenv/lists"}