{"id":14064714,"url":"https://github.com/dotenv-org/python-dotenv-vault","last_synced_at":"2025-09-20T23:47:54.270Z","repository":{"id":61675367,"uuid":"553785392","full_name":"dotenv-org/python-dotenv-vault","owner":"dotenv-org","description":"Load environment variables from encrypted .env.vault files","archived":false,"fork":false,"pushed_at":"2024-04-02T08:43:49.000Z","size":49,"stargazers_count":31,"open_issues_count":7,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T21:21:50.276Z","etag":null,"topics":["dotenv","dotenv-cli","dotenv-python","dotenv-vault","env","environment","environment-variables","secretops-platform","secrets","secrets-management","vault"],"latest_commit_sha":null,"homepage":"https://www.dotenv.org/docs/languages/python","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotenv-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-18T19:10:00.000Z","updated_at":"2025-03-20T03:01:21.000Z","dependencies_parsed_at":"2024-06-21T15:20:47.620Z","dependency_job_id":"d89aea8e-4501-4fd3-83a6-019d8f315b5c","html_url":"https://github.com/dotenv-org/python-dotenv-vault","commit_stats":{"total_commits":64,"total_committers":7,"mean_commits":9.142857142857142,"dds":0.53125,"last_synced_commit":"74dbb2099871fb5a2539e3b12467366cfcb961f4"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotenv-org%2Fpython-dotenv-vault","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotenv-org%2Fpython-dotenv-vault/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotenv-org%2Fpython-dotenv-vault/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotenv-org%2Fpython-dotenv-vault/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotenv-org","download_url":"https://codeload.github.com/dotenv-org/python-dotenv-vault/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248839433,"owners_count":21169816,"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":["dotenv","dotenv-cli","dotenv-python","dotenv-vault","env","environment","environment-variables","secretops-platform","secrets","secrets-management","vault"],"created_at":"2024-08-13T07:04:02.122Z","updated_at":"2025-09-20T23:47:49.214Z","avatar_url":"https://github.com/dotenv-org.png","language":"Python","readme":"# python-dotenv-vault [![PyPI version](https://badge.fury.io/py/python-dotenv-vault.svg)](http://badge.fury.io/py/python-dotenv-vault)\n\n\u003cimg src=\"https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.svg\" alt=\"dotenv-vault\" align=\"right\" width=\"200\" /\u003e\n\nExtends the proven \u0026 trusted foundation of [python-dotenv](https://github.com/theskumar/python-dotenv), with a `.env.vault` file.\n\nThe extended standard lets you load encrypted secrets from your `.env.vault` file in production (and other) environments. Brought to you by the same people that pioneered [dotenv-nodejs](https://github.com/motdotla/dotenv).\n\n* [🌱 Install](#-install)\n* [🏗️ Usage (.env)](#%EF%B8%8F-usage)\n* [🚀 Deploying (.env.vault) 🆕](#-deploying)\n* [🌴 Multiple Environments](#-manage-multiple-environments)\n* [❓ FAQ](#-faq)\n* [⏱️ Changelog](./CHANGELOG.md)\n\n## 🌱 Install\n\n```shell\npip install python-dotenv-vault\n```\n\n## 🏗️ Usage\n\nDevelopment usage works just like [python-dotenv](https://github.com/theskumar/python-dotenv).\n\nAdd your application configuration to your `.env` file in the root of your project:\n\n```shell\nS3_BUCKET=YOURS3BUCKET\nSECRET_KEY=YOURSECRETKEYGOESHERE\n```\n\nAs early as possible in your application bootstrap process, load .env:\n\n```python\nimport os\nfrom dotenv_vault import load_dotenv\n\nload_dotenv()  # take environment variables from .env.\n\n# Code of your application, which uses environment variables (e.g. from `os.environ` or\n# `os.getenv`) as if they came from the actual environment.\n```\n\nWhen your application loads, these variables will be available in `os.environ` or `os.getenv`:\n\n```python\nimport os\ns3_bucket = os.getenv(\"S3_BUCKET\")\nprint(s3_bucket)\n```\n\n## 🚀 Deploying\n\nEncrypt your environment variables by doing:\n\n```shell\nnpx dotenv-vault local build\n```\n\nThis will create an encrypted `.env.vault` file along with a `.env.keys` file containing the encryption keys. Set the `DOTENV_KEY` environment variable by copying and pasting the key value from the `.env.keys` file onto your server or cloud provider. For example in heroku:\n\n```shell\nheroku config:set DOTENV_KEY=\u003ckey string from .env.keys\u003e\n```\n\nCommit your .env.vault file safely to code and deploy. Your .env.vault fill be decrypted on boot, its environment variables injected, and your app work as expected.\n\nNote that when the `DOTENV_KEY` environment variable is set, environment settings will *always* be loaded from the `.env.vault` file in the project root. For development use, you can leave the `DOTENV_KEY` environment variable unset and fall back on the `dotenv` behaviour of loading from `.env` or a specified set of files (see [here in the `dotenv` README](https://github.com/bkeepers/dotenv#usage) for the details).\n\n## 🌴 Manage Multiple Environments\n\nYou have two options for managing multiple environments - locally managed or vault managed - both use [dotenv-vault](https://github.com/dotenv-org/dotenv-vault).\n\nLocally managed never makes a remote API call. It is completely managed on your machine. Vault managed adds conveniences like backing up your .env file, secure sharing across your team, access permissions, and version history. Choose what works best for you.\n\n#### 💻 Locally Managed\n\nCreate a `.env.production` file in the root of your project and put your production values there.\n\n```shell\n# .env.production\nS3_BUCKET=\"PRODUCTION_S3BUCKET\"\nSECRET_KEY=\"PRODUCTION_SECRETKEYGOESHERE\"\n```\n\nRebuild your `.env.vault` file.\n\n```shell\nnpx dotenv-vault local build\n```\n\nView your `.env.keys` file. There is a production `DOTENV_KEY` that pairs with the `DOTENV_VAULT_PRODUCTION` cipher in your `.env.vault` file.\n\nSet the production `DOTENV_KEY` on your server, recommit your `.env.vault` file to code, and deploy. That's it!\n\nYour .env.vault fill be decrypted on boot, its production environment variables injected, and your app work as expected.\n\n#### 🔐 Vault Managed\n\nSync your .env file. Run the push command and follow the instructions. [learn more](/docs/sync/quickstart)\n\n```\n$ npx dotenv-vault push\n```\n\nManage multiple environments with the included UI. [learn more](/docs/tutorials/environments)\n\n```\n$ npx dotenv-vault open\n```\n\nBuild your `.env.vault` file with multiple environments.\n\n```\n$ npx dotenv-vault build\n```\n\nAccess your `DOTENV_KEY`.\n\n```\n$ npx dotenv-vault keys\n```\n\nSet the production `DOTENV_KEY` on your server, recommit your `.env.vault` file to code, and deploy. That's it!\n\n## ❓ FAQ\n\n#### What happens if `DOTENV_KEY` is not set?\n\nDotenv Vault gracefully falls back to [python-dotenv](https://github.com/theskumar/python-dotenv) when `DOTENV_KEY` is not set. This is the default for development so that you can focus on editing your `.env` file and save the `build` command until you are ready to deploy those environment variables changes.\n\n#### Should I commit my `.env` file?\n\nNo. We **strongly** recommend against committing your `.env` file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.\n\n#### Should I commit my `.env.vault` file?\n\nYes. It is safe and recommended to do so. It contains your encrypted envs, and your vault identifier.\n\n#### Can I share the `DOTENV_KEY`?\n\nNo. It is the key that unlocks your encrypted environment variables. Be very careful who you share this key with. Do not let it leak.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md)\n\n## License\n\nMIT\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotenv-org%2Fpython-dotenv-vault","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotenv-org%2Fpython-dotenv-vault","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotenv-org%2Fpython-dotenv-vault/lists"}