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.3.tar.gz (7.5 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.3-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kafkaesque_pylib-0.0.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/6.13.8-200.fc41.x86_64

File hashes

Hashes for kafkaesque_pylib-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d057b7707f91052b829f02d2c02b502f3a6ee9f51e39466c6f4819983ac04332
MD5 776bf4a69620320f045e18a7ee920f59
BLAKE2b-256 7f2b6b47ccbdc83440dfbc462d9393a9192eff68f190d4587b977257fa70923e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kafkaesque_pylib-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/6.13.8-200.fc41.x86_64

File hashes

Hashes for kafkaesque_pylib-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c0a76bdb8f3dadc320b108ff299c816247767087822cad2a26f8e8a86fc3d380
MD5 6f086d00315ad18c33693f3b00fbf6a3
BLAKE2b-256 6d8ba5b92d5102fea21ff87d3d1ca6236e3ca087ca87026935be230e464aa892

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