kafkaesque-pylib
Example
from kafkaesque_pylib import KafkaEsqueConfig, KafkaEsqueContext
from datetime import timedelta
TOPIC = 'test-topic'
# 'DEV' is the name of the kafkaesque cluster config
config = KafkaEsqueConfig.get('DEV')
context = KafkaEsqueContext(config)
# take topic config from kafkaesque, currently only string and avro is supported
topic = context.get_topic(TOPIC)
# topic = context.get_topic(TOPIC, key_type='string', value_type='avro')
tracer = topic.trace_all()
# tracer = topic.trace_newest(amount_per_partition=10, partitions=[0])
# tracer = topic.trace_oldest(amount_per_partition=10)
# tracer = topic.trace_by_time(from_time='P7D', until_time=timedelta(days=1), partitions=[1, 2])
# tracer = topic.trace_by_time(from_time='2025-03-20T12:00:00+01:00', amount_per_partition=100)
# tracer = topic.trace_continuously(partitions=[0])
# tracer = topic.trace_from_specific_offset(offset=10, amount_per_partition=100, partitions=[0])
for message in tracer:
if message.is_erroneous():
# for example deserialization error
print(f"error for {message.key}")
continue
if message.is_tombstone():
print(f"tombstone for {message.key}")
continue
print(message.key)
print(message.value)
print(message.partition)
print(message.offset)
print(message.timestamp)
print(message.header)
print()
Metadata
Release files for kafkaesque-pylib 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kafkaesque_pylib-0.0.5.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kafkaesque_pylib-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.5 kB
Release files / kafkaesque_pylib-0.0.5.tar.gz
| Download URL | kafkaesque_pylib-0.0.5.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13f46e42cc79bf06f69f1276242ebc35f7f379f26a157ec87946b43fa4077a12
|
|
BLAKE2b-256 checksum How to use checksums |
75b4c24915a1e8f706e4f4960bf37aa81a66f5511d8c739e220cdb71acb91f71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.7 Linux/6.16.7-200.fc42.x86_64
|
Release files / kafkaesque_pylib-0.0.5-py3-none-any.whl
| Download URL | kafkaesque_pylib-0.0.5-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23194d49fd65ba5a7b9ce264f7cde6000ebf8a09e7e549499df880a1a285be44
|
|
BLAKE2b-256 checksum How to use checksums |
eb9d51137ad04f19ba0e9aaf47d46f9d15f14747fd3c3b3893a9a17461e72063
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.7 Linux/6.16.7-200.fc42.x86_64
|