Skip to main content

DeployRamp SDK - Feature flag management for Python

Project description

DeployRamp Python SDK

Python SDK for DeployRamp — AI-native feature flag management.

Installation

pip install deployramp

Usage

import deployramp

deployramp.init(deployramp.SdkConfig(
    base_url="https://api.deployramp.com",
    public_token="your-public-token",
    traits={"plan": "pro", "region": "us-east"},
))

if deployramp.flag("my-feature"):
    # feature is enabled
    pass

# Report errors for automatic rollback
try:
    do_something()
except Exception as e:
    deployramp.report(e, flag_name="my-feature")

deployramp.close()

API

init(config: SdkConfig) -> None

Initialize the SDK. Fetches flags and opens a WebSocket for real-time updates.

flag(name: str, trait_overrides: dict | None = None) -> bool

Evaluate a feature flag. Returns False if the SDK is not initialized or the flag is unknown/disabled.

set_traits(traits: dict[str, str]) -> None

Replace the current traits used for flag evaluation.

report(error: Exception | str, flag_name: str | None = None, trait_overrides: dict | None = None) -> None

Report an error to DeployRamp for automatic rollback monitoring.

close() -> None

Flush pending evaluations and close connections.

Requirements

  • Python 3.10+
  • websockets >= 12.0

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

deployramp-0.1.6.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

deployramp-0.1.6-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file deployramp-0.1.6.tar.gz.

File metadata

  • Download URL: deployramp-0.1.6.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deployramp-0.1.6.tar.gz
Algorithm Hash digest
SHA256 76aee2bcf68b4cb7a3e869180d987b52c34c81d45df7701aa90ac63307bbda2c
MD5 102da19d75100e27ca7ddd7e8be2e607
BLAKE2b-256 ae2de340458d447a9eb74c7f7e751c4285399b1b6a415acf5ab210ba05a79129

See more details on using hashes here.

Provenance

The following attestation bundles were made for deployramp-0.1.6.tar.gz:

Publisher: sdk-release-python.yml on deployramp/deployramp

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

File details

Details for the file deployramp-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: deployramp-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deployramp-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e8a10da6eeae76663f2231d88a756ea7bbc2e358a566601d87698456de11d345
MD5 4a00839d97fae63db9be0defa7949eea
BLAKE2b-256 2db336c86e97006120cc6cc4bd78c878f8ac07c3e21a84f409f0ebe460940c51

See more details on using hashes here.

Provenance

The following attestation bundles were made for deployramp-0.1.6-py3-none-any.whl:

Publisher: sdk-release-python.yml on deployramp/deployramp

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