API Reference

kafkaaggregator.app Module

Create a kafka-aggregator application.

Functions

create_app([config])

Create and configure a Faust based kafka-aggregator application.

kafkaaggregator.fields Module

Aggregated field class.

The Field has a numerical type by construction. It holds the name of the source field being aggregated and the operation performed.

Classes

Field(name, type[, source_field_name, operation])

Represents an aggregated field of numeric type.

Class Inheritance Diagram

Inheritance diagram of kafkaaggregator.fields.Field

kafkaaggregator.topics Module

Implements Topic, SourceTopic and AggregationTopic classes.

The Topic class has methods to retrieve the topic schema from the Schema Registry and a parsed list of fields from the Avro schema with Python types.

The child classes SourceTopic and AggregationTopic set the right Schema Registry URL to be used with each topic type.

Classes

SchemaException

A generic schema registry client exception.

Topic(name[, registry_url])

Topic schema and interaction with the Schema Registry.

SourceTopic(name)

Represents source topics.

AggregatedTopic(name)

Represents aggregated topics.

Class Inheritance Diagram

Inheritance diagram of kafkaaggregator.topics.SchemaException, kafkaaggregator.topics.Topic, kafkaaggregator.topics.SourceTopic, kafkaaggregator.topics.AggregatedTopic

kafkaaggregator.models Module

Dynamic creation of Faust-avro Records.

Functions

create_record(cls_name, fields[, doc])

Create a Faust-avro Record class during runtime.

kafkaaggregator.aggregator Module

Create the aggregation model and compute summary statistics.

Given a source topic and a list of field names to exclude from aggregation create the aggregation model and compute summary statistics.

kafka-aggregator adds the aggregation fields time, window_size, and count and computes min, mean, stdev, median, and max statistics for every numeric field in the source topic.

Classes

Aggregator(configfile, aggregated_topic)

Create the aggregation model and compute summary statistics.

kafkaaggregator.generator Module

Generates Faust agents based on the agent.j2 template.

Classes

AgentGenerator(configfile, aggregated_topic)

Generate Faust agents from a list of source topics.

kafkaaggregator.cli Module

Command-line interface for kafkaaggregator.

Functions

main()

Entrypoint for Faust CLI.

Classes

produce(ctx, *args[, key_serializer, ...])

Produce messages for the aggregation example.

init_example(ctx, *args[, key_serializer, ...])

Initialize the source topic used in the aggregation example.

kafkaaggregator.example Module

Aggregation example.

Classes

AggregationExample()

Initialize topics and produce messages for the aggregation example.

UnexpectedNumberOfTopicsError

Raised when the number of source topics is unnexpected.

Class Inheritance Diagram

Inheritance diagram of kafkaaggregator.example.AggregationExample, kafkaaggregator.example.UnexpectedNumberOfTopicsError