Skip to main content

Gradual feature flag SDK for Python

Project description

Gradual Python SDK

CI PyPI version Python versions

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, returning fallback if 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradual_sdk-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradual_sdk-0.1.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

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

Hashes for gradual_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a937a19e9f70b2e96fb991d38ab6001a347681399b4c9afee868f8b9cacfcde8
MD5 59ebb2db3117b1c6f4e990b7b1a5b430
BLAKE2b-256 893f58d610eeac013071d69096ad208f294bb269f7eb711c5d30df1b5ca7542a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradual_sdk-0.1.0.tar.gz:

Publisher: publish.yml on elijahnikov/gradual-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gradual_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d12c45e18cec7172a174a2fde4d8d3328592641c5da06f6c7bea9a3ca41c746
MD5 4c0ebcb70696b33a737ddb7ac7c81f41
BLAKE2b-256 b0bcd5e21b5e332e67c458d56260487b819772da46b64c30c66fd63d84956a90

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradual_sdk-0.1.0-py3-none-any.whl:

Publisher: publish.yml on elijahnikov/gradual-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page