Skip to main content

Automatically inject Doppler secrets as environment variables for use during local development

Project description

doppler-env (experimental)

Automatically inject Doppler secrets as environment variables for use during local development if the DOPPLER_ENV environment variable is set.

Forked from and inspired by patch-env.

NOTE: This package is experimental shoudl be used during local development only. It is not suitable, recommended, or supported for production usage.

Use case

Debugging in IDE's such as Python and Visual Studio Code do not allow the Doppler CLI to be used as the process runner for Python.

This package proposes a solution in the form of a site hook that is run for every Python startup and will inject secrets using a local installation of the Doppler CLI if the DOPPLER_ENV environment variable is set.

Getting started

NOTE: This presumes you've already installed the Doppler CLI and have created a project in Doppler.

  1. Ensure you've configured the Doppler CLI to select the project and config:
doppler setup
  1. Install in doppler-env in your local development environment:
pip install git+https://github.com/dopplerhq/python-doppler-env.git#egg=doppler_env
  1. On the command line or in your editor, set the environment variable DOPPLER_ENV to trigger injecting secrets as environment variables:
export DOPPLER_ENV=1
  1. Run your application as per normal:
python src/app.py

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.1.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

doppler_env-0.1.0-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

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