You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 20, 2026. It is now read-only.
Inject Doppler secrets as environment variables into your Python application during local development. Provides debugging support in PyCharm, Visual Studio Code, and other IDEs and editors.
4
-
5
-
Inspired by [patch-env](https://github.com/caricalabs/patch-env).
6
-
7
-
> NOTE: This package should be used during local development only. It is not suitable, recommended, or supported for production usage.
3
+
Inject Doppler secrets as environment variables into your Python application during local development with built-in debugging support for PyCharm and Visual Studio Code.
8
4
9
5
## How it works
10
6
11
-
Debugging in IDE's such as PyCharm and Visual Studio Code do not allow the Doppler CLI to be used as the process runner for Python as they use their own Python debugger entrypoint. This often forces developers to resort to insecure practices such saving Doppler secrets to an `.env` file during development, the very problem Doppler was created to prevent.
7
+
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.
8
+
9
+
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.
12
10
13
-
The **doppler-env** package provides a solution in the form of a [site hook that is run at Python startup](https://docs.python.org/3/library/site.html).
11
+
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.
14
12
15
-
If the `DOPPLER_ENV` environment variable is set, the package will call out to the Doppler CLI to fetch secrets for the project and inject them as environment variables into the process spwawned by the commmand line or IDE with your secrets never touching the file system.
13
+
All this while ensuring secrets never touch the file system.
16
14
17
15
## Requirements
18
16
19
-
Ensure the [Doppler CLI](https://docs.doppler.com/docs/enclave-installation)is installed and you have [created a project in Doppler](https://docs.doppler.com/docs/enclave-project-setup).
17
+
Ensure you have installed the [Doppler CLI](https://docs.doppler.com/docs/enclave-installation) and [created a project in the Doppler dashboard](https://docs.doppler.com/docs/enclave-project-setup).
20
18
21
-
Then authenticate the Doppler CLI so it can retrieve secrets from your workplace:
19
+
Then in a local terminal, authorize the Doppler CLI to retrieve secrets from your workplace:
22
20
23
21
```sh
24
22
doppler login
25
23
```
26
24
27
25
## Getting started
28
26
29
-
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 for development:
27
+
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:
30
28
31
29
```sh
32
30
doppler setup
@@ -38,14 +36,26 @@ doppler setup
38
36
pip install doppler-env
39
37
```
40
38
41
-
3.On the command line or in your editor, set the environment variable `DOPPLER_ENV` to trigger injecting secrets as environment variables:
39
+
3.Define the `DOPPLER_ENV` environment variable in your IDE, editor, or terminal:
42
40
43
41
```sh
44
42
export DOPPLER_ENV=1
45
43
```
46
44
47
-
4. Run or debug your application as per normal:
45
+
4. Run or debug your application in your IDE, editor, or terminal:
48
46
49
47
```sh
50
48
python src/app.py
51
49
```
50
+
51
+
## Acknowledgements
52
+
53
+
This approach to injecting environment variables was inspired by [patch-env](https://github.com/caricalabs/patch-env) and customized to be Doppler specific.
54
+
55
+
## Issues
56
+
57
+
For any bug reports, issues, or enhancements, please [create a repository issue](https://github.com/DopplerHQ/python-doppler-env/issues/new).
58
+
59
+
## Support
60
+
61
+
Paid subscribers can use in-product support while those on Doppler's free community plan can receive help in our [Community forum](https://community.doppler.com/).
Copy file name to clipboardExpand all lines: setup.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ def long_description():
21
21
22
22
setup(
23
23
name='doppler_env',
24
-
version='0.1.1',
24
+
version='0.2.0',
25
25
python_requires='>=3.8',
26
-
description='Automatically inject Doppler secrets as environment variables for use during local development',
26
+
description='Inject Doppler secrets as environment variables into your Python application during local development with built-in debugging support for PyCharm and Visual Studio Code',
0 commit comments