Skip to main content

Inject Doppler secrets as environment variables into your Python application during local development with debugging support for PyCharm and Visual Studio Code.

Project description

doppler-env

Inject Doppler secrets as environment variables into your Python application during local development with debugging support for PyCharm and Visual Studio Code.

How it works

Debugging support in PyCharm and Visual Studio Code is provided by a vendor-specific Python entry-point which prevents the Doppler CLI from being used to directly inject secrets.

This limitation may force developers to use insecure practices such as saving secrets to an unencrypted .env file—the issue Doppler was created to prevent.

Simply set the DOPPLER_ENV environment variable, and the doppler-env package will fetch your secrets using the Doppler CLI, injecting them as environment variables before executing your Python code.

All this while ensuring secrets never touch the file system.

Requirements

Ensure you have installed the Doppler CLI and created a project in the Doppler dashboard.

Then in a local terminal, authorize the Doppler CLI to retrieve secrets from your workplace:

doppler login

Getting started

  1. If you haven't already, open a new terminal window, change into the repository folder, then configure the Doppler CLI by selecting the project and config to supply secrets for:
doppler setup
  1. Install doppler-env in your local development environment:
pip install doppler-env
  1. Define the DOPPLER_ENV environment variable in your IDE, editor, or terminal:
export DOPPLER_ENV=1
  1. Run or debug your application in your IDE, editor, or terminal:
python src/app.py

Acknowledgements

This approach to injecting environment variables was inspired by patch-env and customized to be Doppler specific.

Issues

For any bug reports, issues, or enhancements, please create a repository issue.

Support

Paid subscribers can use in-product support while those on Doppler's free community plan can receive help in our Community forum.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doppler_env-0.2.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

doppler_env-0.2.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file doppler_env-0.2.1.tar.gz.

File metadata

  • Download URL: doppler_env-0.2.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for doppler_env-0.2.1.tar.gz
Algorithm Hash digest
SHA256 55cb94db53e33943ba2672395fc1fd6e4e4c5d230f4e9a5e7e67be6cb27ad84e
MD5 1e302373a76594c7b723ed944b3d755f
BLAKE2b-256 40456454e0ab359e83fb7516fd7a30891fd855203554deef3445ff865f999ec7

See more details on using hashes here.

File details

Details for the file doppler_env-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: doppler_env-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for doppler_env-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e435d3ca6d20c9bdbec3ce9e08614d3244fa14cdb2b14a9f3d528b9ca419de4c
MD5 44d740eab7521593cf83bc459c4f22b2
BLAKE2b-256 a47340f131a7a727c6bef33c0d20b410784815894f6d754dcc97084f22a64077

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page