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.3

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.3
File Size Uploaded
launchdarkly_eventsource-1.7.3.tar.gz 48.5 kB Details

Built distribution (wheel)

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

Total release size: 78.0 kB

Release files / launchdarkly_eventsource-1.7.3.tar.gz

Download URL launchdarkly_eventsource-1.7.3.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e47e32a4752e60795038deec463f63a6c6e4c20d944df155fa63036edff20450
BLAKE2b-256 checksum
How to use checksums
f5b6be13d4bff6ed3db625bcee9e4aef97496a014d271767be28816fc9502330
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.3-py3-none-any.whl

Download URL launchdarkly_eventsource-1.7.3-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f83f6c8289d1f4b4945522cbd2b8630bd0673e6952eb2af5d32dfa0aa068ee8f
BLAKE2b-256 checksum
How to use checksums
24e068172b381d599a87675c58783387f12fa184a1da54f9f9de7de5cb08e42e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.7.3 This release

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

1 release file

1.0.0

1 release file

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