Skip to main content

DeployRamp Python SDK

PyPI version PyPI downloads License: MIT

Python SDK for DeployRamp — AI-native feature flag management with gradual rollouts, real-time updates, and automatic error-monitored rollbacks.

Installation

pip install deployramp

Quick Start

import deployramp

deployramp.init(deployramp.SdkConfig(
    public_token="drp_pub_your_token",
    traits={"plan": "pro", "region": "us-east"},
))

# Evaluate a feature flag
if deployramp.flag("new-checkout-flow"):
    process_new_checkout()
else:
    process_old_checkout()

# Report errors — DeployRamp uses these to auto-roll back bad deploys
try:
    process_checkout()
except Exception as e:
    deployramp.report(e, flag_name="new-checkout-flow")

deployramp.close()

Trait-Based Targeting

import deployramp

deployramp.init(deployramp.SdkConfig(public_token="drp_pub_your_token"))

# Update traits after login
deployramp.set_traits({"plan": "enterprise", "cohort": "beta"})

# Override traits for a single evaluation
enabled = deployramp.flag("beta-feature", trait_overrides={"cohort": "alpha"})

Measure Performance

Track how each flag branch performs across your user population:

import deployramp

result = deployramp.measure(
    "fast-algorithm",
    enabled_fn=lambda: new_algorithm(data),
    disabled_fn=lambda: old_algorithm(data),
)

API Reference

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.

measure(name: str, enabled_fn, disabled_fn, trait_overrides: dict | None = None)

Run the appropriate branch and report execution time to DeployRamp.

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.

SdkConfig

@dataclass
class SdkConfig:
    public_token: str                      # Required. Your public token from deployramp.com
    base_url: str = "https://flags.deployramp.com"
    traits: dict[str, str] = field(default_factory=dict)

Requirements

  • Python 3.10+
  • websockets >= 12.0

Links

License

MIT

Metadata

Release files for deployramp 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deployramp 0.1.7
File Size Uploaded Provenance
deployramp-0.1.7.tar.gz 9.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for deployramp 0.1.7
File Interpreter ABI Platform
deployramp-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / deployramp-0.1.7.tar.gz

Download URL deployramp-0.1.7.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3838f466d9210a1af36f045ddf14709d636b38b543747f09e55a30ffc51bc0f0
BLAKE2b-256 checksum
How to use checksums
e4f5135e2be02a0318d8c22607a284fc5381c710ddc1a65e0cacc198debae4c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.

Transparency log

Release files / deployramp-0.1.7-py3-none-any.whl

Download URL deployramp-0.1.7-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6b857e93743ac1d687a8210d7b613e5bf6a7148a4046b203626681f01ef450e
BLAKE2b-256 checksum
How to use checksums
e01e3f4655538bfbbea9fa93c1e0cb52319fa395ba699408ae3185fbb0e46dfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.

Transparency log

Security for deployramp 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for deployramp-0.1.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page