Skip to main content

Superstream optimisation library for Kafka producers

Project description

Superclient Python

A Python library for automatically optimizing Kafka producer configurations based on topic-specific recommendations.

Overview

Superstream Clients works as a Python import hook that intercepts Kafka producer creation and applies optimized configurations without requiring any code changes in your application. It dynamically retrieves optimization recommendations from Superstream and applies them based on impact analysis.

Supported Libraries

  • kafka-python
  • aiokafka
  • confluent-kafka
  • Faust
  • FastAPI event publishers
  • Celery Kafka backends
  • Any custom wrapper around these Kafka clients

Features

  • Zero-code integration: No code changes required in your application
  • Dynamic configuration: Applies optimized settings based on topic-specific recommendations
  • Intelligent optimization: Identifies the most impactful topics to optimize
  • Graceful fallback: Falls back to default settings if optimization fails

Installation

pip install superstream-clients && python -m superclient install_pth

That's it! Superclient will now automatically load and optimize all Kafka producers in your Python environment.

Usage

After installation, superclient works automatically. Just use your Kafka clients as usual.

Docker Integration

When using Superstream Clients with containerized applications, include the package in your Dockerfile:

FROM python:3.8-slim

# Install superclient
RUN pip install superstream-clients
RUN python -m superclient install_pth

# Your application code
COPY . /app
WORKDIR /app

# Run your application
CMD ["python", "your_app.py"]

Required Environment Variables

  • SUPERSTREAM_TOPICS_LIST: Comma-separated list of topics your application produces to

Optional Environment Variables

  • SUPERSTREAM_LATENCY_SENSITIVE: Set to "true" to prevent any modification to linger.ms values
  • SUPERSTREAM_DISABLED: Set to "true" to disable optimization
  • SUPERSTREAM_DEBUG: Set to "true" to enable debug logs

Example:

export SUPERSTREAM_TOPICS_LIST=orders,payments,user-events
export SUPERSTREAM_LATENCY_SENSITIVE=true

Prerequisites

  • Python 3.8 or higher
  • Kafka cluster that is connected to the Superstream's console
  • Read and write permissions to the superstream.* topics

License

Apache License 2.0

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

superstream_clients_beta-1.0.1.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

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

superstream_clients_beta-1.0.1-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file superstream_clients_beta-1.0.1.tar.gz.

File metadata

  • Download URL: superstream_clients_beta-1.0.1.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for superstream_clients_beta-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d09f79bda76623737ebc0bd376e77bdd9a63b3dadfe4c1f9a1e7a0f61fd837e9
MD5 1393865db3593520c45fd9524a20521b
BLAKE2b-256 ede3ec7342d97d60a41a1297d5bc54e3410f3e890caaf693f0e9ae6e16cfee74

See more details on using hashes here.

File details

Details for the file superstream_clients_beta-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for superstream_clients_beta-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 031baeb8c1470a69d58b7b63da016c45420b603958be51292c71852304b76776
MD5 e7dab08a726f81a1ea1780eddea568e0
BLAKE2b-256 3d30058dfb2c62f38f93f4f1d7c64f02d564b9e63c5f413b9a9f2ee2e357c176

See more details on using hashes here.

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