Quixplus
This project contains custom data sources for streaming data to QuixStreams using:
- WebSocket: Streams data from WebSocket endpoints.
- CSV: Streams data from CSV files.
- HTTP: Polls data from HTTP APIs at scheduled intervals.
Each source is designed to integrate with QuixStreams for real-time data streaming in Python applications.
Table of Contents
Getting Started
This project requires:
- Python 3.8 or higher
- QuixStreams library
- Access to your data sources (WebSocket endpoints, HTTP APIs, or CSV files)
Environment Setup
Clone this repository:
git clone https://github.com/your-username/your-repo.git
cd your-repo
Install the dependencies:
pip install -r requirements.txt
Set up your environment variables:
To use the application factory method, you need to set up your environment variables.
export BOOTSTRAP_SERVERS=<your-bootstrap-servers>
export SASL_USERNAME=<your-username>
export SASL_PASSWORD=<your-password>
export SASL_MECHANISM=<your-sasl-mechanism>
export SECURITY_PROTOCOL=<your-security-protocol>
Data Sources
WebSocket Source
The WebSocketSource class connects to a WebSocket endpoint, receives data, applies optional transformations, and streams it to QuixStreams.
Key Features:
- Connects to WebSocket URLs.
- Validates and transforms incoming messages.
- Sends data to a specified Kafka topic.
CSV Source
The CSVSource class reads data from a CSV file, transforms each row, and streams it to QuixStreams.
Key Features:
- Reads from CSV files with configurable delimiters.
- Extracts each row as a JSON object, using column headers as keys.
- Supports configurable keys for Kafka messages and value serialization.
HTTP Source
The AIOHTTPSource class polls an HTTP API endpoint at specified intervals, validates the data, and streams it to QuixStreams.
Key Features:
- Asynchronous polling with configurable intervals.
- Flexible authentication (Bearer token, Basic, or custom headers).
- Supports configurable JSON path extraction for Kafka keys and values.
Installation:
Install from PyPI:
pip install quixplus
Add your environment variables to the .env file.
Usage
WebSocket Source Example
To use the WebSocket source, initialize it with the necessary configurations:
from quixstreams import Application
from custom_sources.websocket_source import WebSocketSource
app = Application(broker_address="your_kafka_broker")
ws_source = WebSocketSource(
topic="your_topic",
ws_url="wss://your_websocket_endpoint",
auth_payload={"api_key": "your_key"},
subscribe_payload={"action": "subscribe", "params": "A.*"}
)
sdf = app.dataframe(source=ws_source)
sdf.print()
app.run()
CSV Source Example
To use the CSV source, provide the path to your CSV file and specify the columns for Kafka keys:
from quixstreams import Application
from custom_sources.csv_source import CSVSource
app = Application(broker_address="your_kafka_broker")
csv_source = CSVSource(
topic="your_topic",
csv_path="path/to/your/csv/file.csv",
key_columns=["column1", "column2"]
)
sdf = app.dataframe(source=csv_source)
sdf.print()
app.run()
HTTP Source Example
To use the HTTP source, set the URL and polling interval:
from quixstreams import Application
from custom_sources.http_source import AIOHTTPSource
app = Application(broker_address="your_kafka_broker")
http_source = AIOHTTPSource(
url="https://your-api-endpoint",
poll_interval=10,
auth_type="bearer",
auth_credentials="your_bearer_token",
key_json_path="$.data.id",
value_json_path="$.data"
)
sdf = app.dataframe(source=http_source)
sdf.print()
app.run()
Contributing
We welcome contributions! Please read our CONTRIBUTING.md for guidelines on contributing to this project.
License
This project is licensed under the MIT License.
Metadata
Release files for quixplus 25.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quixplus-25.0.1.tar.gz | 14.1 kB | Without provenance | Details for quixplus-25.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quixplus-25.0.1-py3-none-any.whl | Python 3 | none | any | Details for quixplus-25.0.1-py3-none-any.whl |
Total release size: 27.7 kB
Release files / quixplus-25.0.1.tar.gz
| Download URL | quixplus-25.0.1.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18089a78b958033c2284592f6b955a17ac9bf81f4bdae38bbacc09416668272a
|
|
BLAKE2b-256 checksum How to use checksums |
318c21610346baf95fd431ea184de25b02ebc7eabb5c9b4255e69a0fa79d6838
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.29
|
Release files / quixplus-25.0.1-py3-none-any.whl
| Download URL | quixplus-25.0.1-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5a5460df38be0137e55ca70b7b7c9f96650ba3d95e203a7df749098b53ce5a3
|
|
BLAKE2b-256 checksum How to use checksums |
d1cea24347a8db98255656b62d8ee7defd593b31b5142f3591a25f2e9461cf43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.29
|
Security for quixplus 25.0.1
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.