https://github.com/superstreamlabs/superclient-python
https://github.com/superstreamlabs/superclient-python
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/superstreamlabs/superclient-python
- Owner: superstreamlabs
- License: other
- Created: 2025-06-09T18:26:47.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-07-20T07:56:13.000Z (11 months ago)
- Last Synced: 2025-08-19T15:15:58.364Z (10 months ago)
- Language: Python
- Size: 163 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README

# 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
```bash
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:
```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:
```bash
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