Gradual feature flag SDK for Python
Project description
Gradual Python SDK
The official Python SDK for Gradual feature flags.
Installation
pip install gradual-sdk
Quick Start
from gradual import create_gradual, GradualOptions
client = create_gradual(GradualOptions(
api_key="gra_xxx",
environment="production",
))
client.wait_until_ready()
if client.is_enabled("new-feature"):
# new code path
pass
theme = client.get("theme", fallback="dark")
client.identify({"user": {"id": "user-123", "plan": "pro"}})
client.close()
API Reference
create_gradual(options: GradualOptions)-- Create and return a new Gradual client instance.client.wait_until_ready()-- Block until the client has fetched its initial flag configuration.client.is_enabled(flag: str) -> bool-- Check whether a boolean feature flag is enabled.client.get(flag: str, fallback=None)-- Get the value of a feature flag, returningfallbackif the flag is not found.client.identify(context: dict)-- Set the evaluation context (e.g. user attributes) for subsequent flag checks.client.close()-- Shut down the client and release resources.
Development
Install the package in development mode with test dependencies:
pip install -e ".[dev]"
Run the tests:
PYTHONPATH=src pytest tests/ -v
License
MIT
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 gradual_sdk-0.1.0.tar.gz.
File metadata
- Download URL: gradual_sdk-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a937a19e9f70b2e96fb991d38ab6001a347681399b4c9afee868f8b9cacfcde8
|
|
| MD5 |
59ebb2db3117b1c6f4e990b7b1a5b430
|
|
| BLAKE2b-256 |
893f58d610eeac013071d69096ad208f294bb269f7eb711c5d30df1b5ca7542a
|
Provenance
The following attestation bundles were made for gradual_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on elijahnikov/gradual-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradual_sdk-0.1.0.tar.gz -
Subject digest:
a937a19e9f70b2e96fb991d38ab6001a347681399b4c9afee868f8b9cacfcde8 - Sigstore transparency entry: 1144886483
- Sigstore integration time:
-
Permalink:
elijahnikov/gradual-python@b95d766a39a950ba8b80c00c66de3ecdf96a3723 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/elijahnikov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b95d766a39a950ba8b80c00c66de3ecdf96a3723 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gradual_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gradual_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.1 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 |
4d12c45e18cec7172a174a2fde4d8d3328592641c5da06f6c7bea9a3ca41c746
|
|
| MD5 |
4c0ebcb70696b33a737ddb7ac7c81f41
|
|
| BLAKE2b-256 |
b0bcd5e21b5e332e67c458d56260487b819772da46b64c30c66fd63d84956a90
|
Provenance
The following attestation bundles were made for gradual_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on elijahnikov/gradual-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradual_sdk-0.1.0-py3-none-any.whl -
Subject digest:
4d12c45e18cec7172a174a2fde4d8d3328592641c5da06f6c7bea9a3ca41c746 - Sigstore transparency entry: 1144886580
- Sigstore integration time:
-
Permalink:
elijahnikov/gradual-python@b95d766a39a950ba8b80c00c66de3ecdf96a3723 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/elijahnikov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b95d766a39a950ba8b80c00c66de3ecdf96a3723 -
Trigger Event:
release
-
Statement type: