Python adapter for Kafka
Project description
NAAS-PYTHON-KAFKA
This is the Kafka adapter for Python: it allows you to easily connect Python services to Apache Kafka via Python.
The implementation is a wrapper around Confluent-Kafka-Python:
- AVRO schema's and messages: both key's and values should have a schema. as explained here.
- Kafka consumer and producer for the test-bed topics.
- Management
- Heartbeat (topic: system-heartbeat), so you know which clients are online. Each time the test-bed-adapter is executed, it starts a heartbeat process to notify the its activity to other clients.
Installation
You need to install Python 3+.
To run the examples you will need to install the dependencies specified on the file requirements.txt.
For that, run
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt # Or instead of `pip`, use `pip3`
from the project folder.
Examples and usage
- url_producer: creates a message with 4 URLs to RSS feeds on the topic ('system_rss_urls')
- rss_producer: listens to url messages ('system_rss_urls') and produces RSS messages ('system_rss_urls')
- rss_consumer: listens to RSS messages ('system_rss_urls') and prints them to console.
Uploading to PyPi
- Ensure you have the necessary tools installed: Make sure you have
setuptools
andwheel
installed. You can install them usingpip
:
pip install setuptools wheel
Build the distribution files: In the root directory of your project, run the following command to build the distribution files (wheel and source distribution):
- Build the distribution files: In the root directory of your project, run the following command to build the distribution files (wheel and source distribution):
python setup.py sdist bdist_wheel
This command will generate the distribution files inside the dist directory.
This command will generate the distribution files inside the dist directory.
-
Register an account on PyPI: If you haven't done so already, create an account on PyPI and verify your email address.
-
Install and configure
twine
: Installtwine
, a tool used to upload packages to PyPI, usingpip
:
pip install twine
Upload the package to PyPI: Use twine to upload the distribution files to PyPI:
- Upload the package to PyPI: Use twine to upload the distribution files to PyPI:
twine upload dist/*
This command will prompt you to enter your PyPI username and password. Once provided, twine will upload the distribution files to PyPI.
This command will prompt you to enter your PyPI username and password. Once provided, twine will upload the distribution files to PyPI.
- Verify the package on PyPI: Visit your package page on PyPI to ensure that the package has been successfully uploaded and published.
Remember to update the version number in your setup.py
file for each new release to avoid conflicts.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file osint-python-test-bed-adapter-2.3.3.tar.gz
.
File metadata
- Download URL: osint-python-test-bed-adapter-2.3.3.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 567d3356dbb929926650b49753158052a42a30279897586a6cb2cb105c4b2f54 |
|
MD5 | 92f2a6c3d483312491ba85c62c3a4f62 |
|
BLAKE2b-256 | 60fe3294e370fc50d5b4ef1a65059e265362ea2c758f6aad213056d7487aaafa |
File details
Details for the file osint_python_test_bed_adapter-2.3.3-py3-none-any.whl
.
File metadata
- Download URL: osint_python_test_bed_adapter-2.3.3-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 505967fc70022618e636648a33974adef2bb04172ef66264352fec14ab1f4678 |
|
MD5 | 7c29df69b94475296217940994708b69 |
|
BLAKE2b-256 | 5bc994a8b6848c0b71ea86eb1d1b40f842b5e0331799c444cf5be2649c153cdb |