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.5.tar.gz (8.3 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.5-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deployramp-0.1.5.tar.gz
  • Upload date:
  • Size: 8.3 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.5.tar.gz
Algorithm Hash digest
SHA256 dbe7f4664145ca2df255fbf4a5e69411cb7f98e9896a6c0feb21991d4ccc3d88
MD5 690dd27603ab27d516cf744d199a05dc
BLAKE2b-256 b9a6c35d166083b489f98f652b8676de1d50c0497d2d338517524cb6ce43168d

See more details on using hashes here.

Provenance

The following attestation bundles were made for deployramp-0.1.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: deployramp-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 558e12fe4461aff06d4f727992f4895490c067e1fb6baba5b6f3ace944510889
MD5 4d91fd17a23a5e417191cc4f2abd71f0
BLAKE2b-256 b1e68daa5fc6a9773d588616f154a470e3b0968e0c129e543324f9d26d58ea12

See more details on using hashes here.

Provenance

The following attestation bundles were made for deployramp-0.1.5-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