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.5.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.5-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kafkaesque_pylib-0.0.5.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.7 Linux/6.16.7-200.fc42.x86_64

File hashes

Hashes for kafkaesque_pylib-0.0.5.tar.gz
Algorithm Hash digest
SHA256 13f46e42cc79bf06f69f1276242ebc35f7f379f26a157ec87946b43fa4077a12
MD5 d19c1c9d0d9c74ca7d957807cc1a85cf
BLAKE2b-256 75b4c24915a1e8f706e4f4960bf37aa81a66f5511d8c739e220cdb71acb91f71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kafkaesque_pylib-0.0.5-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.7 Linux/6.16.7-200.fc42.x86_64

File hashes

Hashes for kafkaesque_pylib-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 23194d49fd65ba5a7b9ce264f7cde6000ebf8a09e7e549499df880a1a285be44
MD5 57a691d26d1598d6e00941700683088e
BLAKE2b-256 eb9d51137ad04f19ba0e9aaf47d46f9d15f14747fd3c3b3893a9a17461e72063

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