Install & Compatibility
Where this runs
tested against v1.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.760s · 23.2MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.3s · import 0.676s · 24MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DopplerSDK
✓ from dopplersdk import DopplerSDK
This quickstart initializes the DopplerSDK client using an access token, preferably sourced from an environment variable like `DOPPLER_TOKEN`. It then demonstrates how to list available projects. For local development, Doppler recommends using `doppler run` or the `doppler-env` package for secure secret injection without manual token handling.
import os
from pprint import pprint
from dopplersdk import DopplerSDK
# Ensure your Doppler Service Token is set as an environment variable (e.g., DOPPLER_TOKEN)
# For local development, it's recommended to use `doppler run -- python your_app.py`
# or the doppler-env package for IDE integration.
# Alternatively, you can set it directly from an environment variable for server-side use.
DOPPLER_TOKEN = os.environ.get('DOPPLER_TOKEN', '')
if not DOPPLER_TOKEN:
print("Error: DOPPLER_TOKEN environment variable not set.")
print("Please ensure you have authenticated the Doppler CLI (doppler login, doppler setup) ")
print("or set the DOPPLER_TOKEN environment variable.")
else:
try:
doppler = DopplerSDK(access_token=DOPPLER_TOKEN)
# Example: List all projects
results = doppler.projects.list()
print("Successfully fetched Doppler projects:")
pprint(results.to_dict()) # Use .to_dict() to convert the object to a dictionary for pprint
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingVersion 1.3.0 introduced changes to the `Secrets` type within `SecretsUpdateRequest` and added a `change_request` field. Users directly manipulating these types might need to adjust their code upon upgrading.fixReview the `SecretsUpdateRequest` and `Secrets` types in the SDK's API reference or `sample.py` on GitHub for updated structure and incorporate `change_request` if applicable.
affects: >=1.3.0
deprecatedThe `doppler-client` package (a distinct, older library) is deprecated and no longer functional. Do not confuse it with `doppler-sdk`.fixEnsure you are installing and importing `doppler-sdk` (e.g., `pip install doppler-sdk`, `from dopplersdk import DopplerSDK`) and not the deprecated `doppler-client`.
affects: <1.0.0 (doppler-client), all (doppler-sdk)
gotchaFor local development and debugging in IDEs (like PyCharm, VS Code), direct `doppler run` command invocation might not work for secret injection. The `doppler-env` package is often necessary.fixInstall `doppler-env` (`pip install doppler-env`) and set the environment variable `DOPPLER_ENV=1` in your IDE's run configuration to enable automatic secret injection.
affects: all
gotchaNetwork connectivity issues, particularly related to DNS resolution, can cause 'Client.Timeout exceeded' errors when the SDK attempts to connect to the Doppler API, especially with certain network configurations (e.g., Google WiFi, VPNs).fixIf experiencing network timeouts, configure your system or the Doppler CLI (if used for authentication) to use a reliable public DNS resolver (e.g., 1.1.1.1 or 8.8.8.8). This can often be done via environment variables (`DOPPLER_DNS_RESOLVER=1.1.1.1`) or direct system DNS settings.
affects: all
Upgrade
Version history
1.3.0latest on PyPI · released Apr 8, 2024
Audit
Dependencies
doppler-envoptionalRecommended for seamless secret injection during local development and debugging in IDEs like PyCharm and VS Code.