Skip to main content

No project description provided

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kafkaesque_pylib-0.0.4.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kafkaesque_pylib-0.0.4-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file kafkaesque_pylib-0.0.4.tar.gz.

File metadata

  • Download URL: kafkaesque_pylib-0.0.4.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.3 Linux/6.14.11-300.fc42.x86_64

File hashes

Hashes for kafkaesque_pylib-0.0.4.tar.gz
Algorithm Hash digest
SHA256 18d7aea983bf8628cd3e6d127cd44e63b42dffb30f342d3140dbf0fe910a546c
MD5 e217d66eda3c27ea6e210c978d80c9be
BLAKE2b-256 56cac2c87671bd13a9e0b8976dfbbd7a5678e82ab6f3b492785dfbf1314e904c

See more details on using hashes here.

File details

Details for the file kafkaesque_pylib-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: kafkaesque_pylib-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.3 Linux/6.14.11-300.fc42.x86_64

File hashes

Hashes for kafkaesque_pylib-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0f72e453b9981daf24c2aa906d0a307b9f439389026e420a1729af6c730d83e1
MD5 027810566db072562245ab24831c9f6a
BLAKE2b-256 bdce6208f935cb6f2cf6927ff7ae636fb285b66f3004ba560a227905a477c260

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page