Skip to main content

LaunchDarkly SSE Client for Python

Run CI PyPI readthedocs

Overview

The launchdarkly/python-eventsource package allows Python developers to consume Server-Sent-Events (SSE) from a remote API. The SSE specification is defined here: https://html.spec.whatwg.org/multipage/server-sent-events.html

This package's primary purpose is to support the LaunchDarkly SDK for Python, but it can be used independently. In its simplest configuration, it emulates the behavior of the EventSource API as defined in the SSE specification, with the addition of exponential backoff behavior for retries. However, it also includes optional features used by LaunchDarkly SDKs that are not part of the core specification, such as:

  • Customizing the backoff/jitter behavior.
  • Setting read timeouts, custom headers, and other HTTP request properties.
  • Specifying that connections should be retried under circumstances where the standard EventSource behavior would not retry them, such as if the server returns an HTTP error status.

The default SSEClient is a synchronous implementation which blocks the caller's thread when reading events or reconnecting. By default, it uses urllib3 to make HTTP requests, but it can be configured to read any input stream.

An async implementation, AsyncSSEClient, is also available for use with asyncio-based applications. It uses aiohttp for HTTP and requires installing the optional async extra:

pip install launchdarkly-eventsource[async]

Supported Python versions

This version of the package is compatible with Python 3.10 and higher.

Contributing

We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.

About LaunchDarkly

  • LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
    • Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
    • Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
    • Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
    • Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
  • LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read our documentation for a complete list.
  • Explore LaunchDarkly

Metadata

Release files for launchdarkly-eventsource 1.7.4

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

Source distribution (sdist)

Source distribution for launchdarkly-eventsource 1.7.4
File Size Uploaded Provenance Actions
launchdarkly_eventsource-1.7.4.tar.gz 46.1 kB Without provenance Details for launchdarkly_eventsource-1.7.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for launchdarkly-eventsource 1.7.4
File Interpreter ABI Platform Actions
launchdarkly_eventsource-1.7.4-py3-none-any.whl Python 3 none any Details for launchdarkly_eventsource-1.7.4-py3-none-any.whl

Total release size: 75.6 kB

Release files / launchdarkly_eventsource-1.7.4.tar.gz

Download URL launchdarkly_eventsource-1.7.4.tar.gz
Size 46.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0a608da152a53bd05f5b4a2486828f21d48cd25a56986e36a8e47a8e9975e309
BLAKE2b-256 checksum
How to use checksums
ac6c60862f8143c8185e953410b30125ff37ce4720fac2042771ca00f115f840
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / launchdarkly_eventsource-1.7.4-py3-none-any.whl

Download URL launchdarkly_eventsource-1.7.4-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42bbaee1741675199be193d99229ecb710a94089e74fc68b8c4edb90cddbdc5e
BLAKE2b-256 checksum
How to use checksums
8ce36dae165ff56bba3ad4fc76b2aa8c4606c577d2e33a9053dc147b03b045b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for launchdarkly-eventsource 1.7.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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