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.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: doppler_env-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 8d7a66e5526d0b62ee3c7b85c7d3632f81831668f916d9400aa6ca4002f45617
MD5 c922b0773c47667762c2a56a2fe02528
BLAKE2b-256 3bd1a36ce990df08ca89b69ecf589f8412917f646069e9f6ed1154130097bf67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: doppler_env-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c7dded46c4fa645e48fdf06fcd04e0fd0e0515ce532a74910d8420eb81b115e
MD5 4cfab17b39480dfb8618f4a6ff1f21fd
BLAKE2b-256 2ea8c4ac65c29df0fdfbf0c7561cd172b2e812c542361716ffbe47a82541d993

See more details on using hashes here.

Supported by

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