Registry / workflow / devcycle-python-server-sdk

devcycle-python-server-sdk

JSON →
library3.13.10pypypi✓ verified 87d ago

The DevCycle Python Server SDK provides real-time feature flag delivery and experimentation capabilities for Python applications. It allows developers to define, manage, and evaluate feature flags and A/B tests to deliver personalized experiences. The SDK fetches configurations, evaluates variables, and tracks events. The current version is 3.13.7, with frequent releases addressing bug fixes and minor feature enhancements.

pip install devcycle-python-server-sdk
INSTALL
IMPORT
SIG · DEVCYCLE-PYTHON-SE
D
devcycle-python-server-sdk
workflowpythonv3.13.10
Install
3.6s avg
Import
—
Disk
54MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.13.9 · 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
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 50.9MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 3.6s · import 0.000s · 52MB
54MB installed
● package 54MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DevCycleCloudClient
✓ from devcycle_python_sdk import DevCycleCloudClient
✗ from devcycle_python_sdk import DevCycleClient
DevCycleLocalClient
✓ from devcycle_python_sdk import DevCycleLocalClient
✗ from devcycle_python_sdk import DevCycleClient
DevCycleCloudOptions
✓ from devcycle_python_sdk import DevCycleCloudOptions

Initializes the DevCycle client, waits for it to fetch configurations, defines a user, and evaluates a boolean and a string variable. It uses an environment variable for the SDK key and demonstrates asynchronous usage, which is mandatory for this SDK.

import os import asyncio from devcycle_python_sdk import DevCycleClient, DevCycleOptions, DevCycleUser DEVCYCLE_SERVER_SDK_KEY = os.environ.get('DEVCYCLE_SERVER_SDK_KEY', '') async def main(): if not DEVCYCLE_SERVER_SDK_KEY: print("Error: DEVCYCLE_SERVER_SDK_KEY environment variable not set.") return # Configure options, e.g., enable cloud bucketing for server-side evaluation # By default, local bucketing (WASM) is used if not specified options = DevCycleOptions(enable_cloud_bucketing=True) client = DevCycleClient(DEVCYCLE_SERVER_SDK_KEY, options) try: # Wait for the client to be initialized and fetch configurations await client.on_initialized() print("DevCycle client initialized.") # Define a user for feature evaluation user = DevCycleUser( user_id="example-user", email="test@example.com", country="US" ) # Evaluate a boolean variable feature_enabled = await client.variable(user, "my-feature", False) if feature_enabled.value: print("Feature 'my-feature' is ON for the user.") else: print("Feature 'my-feature' is OFF for the user.") # Evaluate a string variable welcome_message = await client.variable(user, "welcome-text", "Hello!") print(f"Welcome message for user: {welcome_message.value}") except Exception as e: print(f"An error occurred during DevCycle operations: {e}") finally: # Ensure the client is closed to release resources await client.close() print("DevCycle client closed.") if __name__ == '__main__': asyncio.run(main())
Debug
Known issues
breakingVersion 3.0.0 introduced significant breaking changes, including a complete rewrite of the SDK. The `DevCycle` class was replaced with `DevCycleClient`, and the SDK shifted to an asynchronous (`asyncio`) programming model. Method signatures for initialization and variable evaluation changed substantially.
fix
Migrate existing code to use `DevCycleClient` and adapt to the `async`/`await` pattern. Ensure all SDK operations are awaited and handled within an `asyncio` event loop. Consult the official v3 migration guide if available or the latest README.
affects: <3.0.0 to 3.0.0+
gotchaThe SDK is built on `asyncio`. Attempting to use `DevCycleClient` methods without `await` or outside a running `asyncio` event loop will lead to `RuntimeError` or unexpected behavior (e.g., tasks not completing).
fix
Always `await` calls to `client.on_initialized()`, `client.variable()`, `client.close()`, and other asynchronous methods. Ensure your application's entry point correctly uses `asyncio.run()` or manages the event loop for SDK operations.
affects: 3.0.0+
gotchaIncorrect or expired DevCycle Server SDK keys can lead to the SDK failing to fetch configurations or stopping polling for updates. This often results in default variable values being used or evaluation errors, without clear immediate indication in variable calls.
fix
Double-check that your `DEVCYCLE_SERVER_SDK_KEY` is valid, has the correct permissions (server-side, not client-side), and is passed correctly during `DevCycleClient` initialization. Monitor application logs for HTTP 401/403 errors from the DevCycle API that indicate an invalid key.
affects: All versions
gotchaThe SDK offers both local bucketing (WASM) and cloud bucketing modes, controlled by `DevCycleOptions`. The default behavior for `enable_cloud_bucketing` can affect performance, network usage, and consistency if not explicitly configured.
fix
Explicitly set `enable_cloud_bucketing` in `DevCycleOptions` based on your requirements. For optimal performance and offline capabilities, set `enable_cloud_bucketing=False` and consider `DevCycleLocalBucketingOptions`. For simpler server-side integration that relies on DevCycle's cloud, set `enable_cloud_bucketing=True`.
affects: 3.0.0+
Upgrade
Version history
3.13.10latest on PyPI · released May 27, 2026
Audit
Dependencies
openfeature-sdkrequiredUsed for OpenFeature integration and standardizing feature flag evaluation interfaces. Required for functionality.
Agent activity
20 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
devcycle-python-server-sdk — pip install devcycle-python-server-sdk · libregistry