Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

tkati-core

tkati-core provides the building blocks for streaming data pipeline nodes that read from Kafka and write to Kafka or ClickHouse.

Settings

General form of settings is:

[input.topic]
# definition of input stream:
# - broker
# - topic name
# - message schema
# - message format = "json" / "arrow-batch"

[input.consumer]
# parameters local to this consumer
# - group_id
# - batch_size
# - batch_timeout_sec
# - auto_offset_reset

[output.topic]
# definition of output stream
# - broker
# - topic name
# - message schema
# - message format = "json" / "arrow-batch"
# - key_column (optional) = column to use as the Kafka message key

[...]
# settings specific to node function

Usage

Constructing a consumer from settings

Use KafkaArrowConsumer.from_input_settings to construct a consumer directly from KafkaInputSettings — no need to manually map fields to Confluent Kafka config keys.

from tkati_core.settings import TomlBaseSettings, KafkaInputSettings
from tkati_core.consumer import KafkaArrowConsumer

class AppSettings(TomlBaseSettings):
    input: KafkaInputSettings
    # ...

settings = AppSettings()
consumer = KafkaArrowConsumer.from_input_settings(settings.input)

# Read a batch
table = consumer.read_to_pyarrow(
    aggregation_interval_seconds=settings.input.consumer.batch_timeout_sec,
    max_events_to_aggregate=settings.input.consumer.batch_size,
)
consumer.commit()

The factory method sets enable.auto.commit=False — offsets must be committed explicitly via consumer.commit().

Constructing a producer from settings

Use KafkaArrowProducer.from_output_settings to construct a producer directly from KafkaOutputSettings. It accepts PyArrow tables or record batches and handles serialization according to the topic's format setting.

from tkati_core.settings import TomlBaseSettings, KafkaOutputSettings
from tkati_core.producer import KafkaArrowProducer

class AppSettings(TomlBaseSettings):
    output: KafkaOutputSettings
    # ...

settings = AppSettings()
producer = KafkaArrowProducer.from_output_settings(settings.output)

# Produce a PyArrow table (one message per row for "json" format)
producer.produce(table)
producer.flush()
producer.close()  # flushes and releases resources

Formats — controlled by output.topic.format in settings.toml:

  • "json" (default): each row becomes a separate Kafka message serialized with orjson.
  • "arrow-batch": the entire table is serialized as a single Arrow IPC stream message.

Message keys — controlled by output.topic.key_column in settings.toml:

[output.topic]
broker = "localhost:9092"
name = "my-output-topic"
key_column = "customer_id"   # column whose value becomes the Kafka message key

key_column is optional. When omitted (or None), messages are produced without a key. When set, the value of that column for each row is used as the Kafka message key (JSON format only — ignored for "arrow-batch"). This determines which Kafka partition each message is routed to.

Download files

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

Source Distribution

tkati_core-0.3.0a1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

tkati_core-0.3.0a1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file tkati_core-0.3.0a1.tar.gz.

File metadata

  • Download URL: tkati_core-0.3.0a1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tkati_core-0.3.0a1.tar.gz
Algorithm Hash digest
SHA256 4cb57103f5a282b35437ef72640b2047c2f397ea85705169f793755f91b3df7a
MD5 5851fb6c84f1ae16b0082350d5997bb6
BLAKE2b-256 8cd563ade0112713b030018067f466b75bbf4957c5f649b5e2bb838c9724857e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkati_core-0.3.0a1.tar.gz:

Publisher: publish-tkati-core.yml on epoch8/tkati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tkati_core-0.3.0a1-py3-none-any.whl.

File metadata

  • Download URL: tkati_core-0.3.0a1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tkati_core-0.3.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c77fca8e9b9aced4864910d6154d3ca0319557226fe1e9915ecce59981e940b
MD5 218e20fe4b6a86b14bea9eeebaa57d44
BLAKE2b-256 d06b017583658b07d5b3aeb17a61cd8ba501a9560d16f89a53342ff19a00990d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkati_core-0.3.0a1-py3-none-any.whl:

Publisher: publish-tkati-core.yml on epoch8/tkati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.0

2 files

This release

0.3.0a1 This release

2 files

0.2.0.post3

2 files

0.2.0.post2

2 files

0.2.0.post1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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