pymapr-kafkarest
Introduction
The aim of the project is to create a super-simple wrapper for MAPR Kafka REST proxy. We're trying to allow users to interact with MAPR Kafka in an elementary way and writing less code as possible.
The original documentation of the REST calls can be found here.
Installation
Soon available via pip:
pip install pymapr-kafkarest
Runtime configurations
KAFKAREST_LOG_LEVEL: allows to set the log level... default toDEBUG
TBC
Usage
Import the lib
from pymapr_kafkarest import MaprKlient
Define basic attributes
base_url = 'http://my-endopoint:8082'
user_group = 'foo'
topics = ['/streams/foo:bar']
and instantiate the client
mk = MaprKlient(base_url, user_group, topics=topics)
Connect, subscribe and consume messages as follows:
base_url = 'http://my-endopoint:8082'
if __name__ == '__main__':
mk = MaprKlient(base_url, user_group, headers=headers, topics=topics)
mk.connect(clear=True)
mk.subscribe()
messages = mk.consume()
print(messages)
Connect and produce messages:
from pymapr_kafkarest import MaprKlient
from pymapr_kafkarest.kafkarest import MaprKProducer
base_url = 'https://localhost:8082'
headers = {}
user_group = 'me'
if __name__ == '__main__':
# producing
mp = MaprKProducer(base_url, user_group, headers=headers)
msgs = [dict(key='0099', value=dict(color='red', shape='square'))]
mp.produce(messages=msgs, topic='/streams/foo')
TODO
- a lot of methods are not yet implemented
- full read the docs
- chain
connect,subscribeandconsumein a new method namedstream
Metadata
Release files for pymapr-kafkarest 0.1.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 |
|---|---|---|---|---|
| pymapr-kafkarest-0.1.1.tar.gz | 5.3 kB | Without provenance | Details for pymapr-kafkarest-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymapr_kafkarest-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pymapr_kafkarest-0.1.1-py3-none-any.whl |
Total release size: 11.1 kB
Release files / pymapr-kafkarest-0.1.1.tar.gz
| Download URL | pymapr-kafkarest-0.1.1.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86ef1a5c88cbbe7b81d89bb7a2d6058b079ee0cb69d3eeed47966e0d30600b59
|
|
BLAKE2b-256 checksum How to use checksums |
aa6f3ca8f6e583a947e91584d060bf3bb2f4880bd2928b912f9e9474e089c4e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / pymapr_kafkarest-0.1.1-py3-none-any.whl
| Download URL | pymapr_kafkarest-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2dd58d25a1a6f7d052685b3be2d125e813b7a61610e19833a620edc3052093de
|
|
BLAKE2b-256 checksum How to use checksums |
b4cd7766805e198600aecbb995338ee6a089648a2741d2190b3283380b59eb65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Security for pymapr-kafkarest 0.1.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.