Seamlessly and securely inject Doppler secrets into Google Colab notebook environments.
Project description
doppler-colab
Seamlessly and securely inject Doppler secrets into Google Colab interactive environments.
When working in ephemeral environments like Google Colab, managing secrets securely is a challenge. doppler-colab natively integrates with Colab's built-in Secrets management to securely fetch your environment variables from the Doppler API and inject them silently into os.environ.
No CLI dependencies, no leaking print statements, and downstream libraries instantly work.
Installation
Install the package directly inside your Colab notebook:
!pip install -q doppler-colab
Setup
- Generate a Service Token inside your Doppler dashboard. (Service tokens enforce scoping and ensure you safely access the correct environment).
- Open your Google Colab notebook.
- Click the 🔑 Secrets icon on the left sidebar.
- Add a new secret with the name
DOPPLER_TOKENand paste in your Service Token (dp.st...). - Ensure the "Notebook access" toggle is explicitly switched ON next to the token, enabling read-access for your environment.
(Fallback: If you are not in Colab, or are on Colab Enterprise the package will automatically check os.environ["DOPPLER_TOKEN"] as a fallback).
Usage
Method 1: Python API
Invoke the package manually to fetch and load your secrets:
import doppler_colab
doppler_colab.load()
# ✅ Successfully injected 14 secrets from Doppler [Project: your-project] into the environment.
Method 2: IPython Cell Magic
For a cleaner interactive workflow, use the %doppler_load magic command at the top of your cells:
import doppler_colab
%doppler_load
Secure by Default
- Silent Payloads:
doppler-colabwill never print the returned payload or tokens. You only receive a safe confirmation of the number of imported parameters. - Service Token Enforcement:
doppler-colabenforces the use of scoped Service Tokens (dp.st.*). Personal tokens, CLI tokens, and other token types are rejected with a clear error message.
Disclaimer & Acknowledgements
Please note: This is a community-driven project and is not an official Doppler product, nor is it officially endorsed by Doppler.
This refactoring and adaptation to Google Colab would not have been possible without the foundational work of the original authors at Doppler on the python-doppler-env package.
For bug reports or feature requests specifically related to this Colab adaptation, please create an issue on this repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file doppler_colab-0.4.1.tar.gz.
File metadata
- Download URL: doppler_colab-0.4.1.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e9ffe4c8c8ecfebf2e650ce293106761f7af5afc9c393e175874f9554f7b72
|
|
| MD5 |
f7099a329b8e44b80782e30154d89056
|
|
| BLAKE2b-256 |
2e62280b8eba5d894abd8dccbf2197c0e71b7c428fe6c932cd702ec66c88412c
|
Provenance
The following attestation bundles were made for doppler_colab-0.4.1.tar.gz:
Publisher:
release.yml on jhaisley/doppler-colab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doppler_colab-0.4.1.tar.gz -
Subject digest:
a0e9ffe4c8c8ecfebf2e650ce293106761f7af5afc9c393e175874f9554f7b72 - Sigstore transparency entry: 1228163150
- Sigstore integration time:
-
Permalink:
jhaisley/doppler-colab@b9944ad83dd35f8238c4fc042a013ba6be6fa5a6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jhaisley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b9944ad83dd35f8238c4fc042a013ba6be6fa5a6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file doppler_colab-0.4.1-py3-none-any.whl.
File metadata
- Download URL: doppler_colab-0.4.1-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afd334121e434c02b496129c559793ca16c359df5b2d23c6f9970cbd9cdcfdf8
|
|
| MD5 |
4bf9025198dffa01a9d8032ed466a119
|
|
| BLAKE2b-256 |
0fd20f99fbf3c8055a52796efa82f410f58684c22d1491968051e7cdefa4a749
|
Provenance
The following attestation bundles were made for doppler_colab-0.4.1-py3-none-any.whl:
Publisher:
release.yml on jhaisley/doppler-colab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doppler_colab-0.4.1-py3-none-any.whl -
Subject digest:
afd334121e434c02b496129c559793ca16c359df5b2d23c6f9970cbd9cdcfdf8 - Sigstore transparency entry: 1228163176
- Sigstore integration time:
-
Permalink:
jhaisley/doppler-colab@b9944ad83dd35f8238c4fc042a013ba6be6fa5a6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jhaisley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b9944ad83dd35f8238c4fc042a013ba6be6fa5a6 -
Trigger Event:
workflow_dispatch
-
Statement type: