pico-kafka
Kafka for the pico ecosystem: @kafka_consumer methods and declarative @kafka_producer clients over aiokafka.
Installation
pip install pico-kafka
Quick start
kafka:
bootstrap_servers: kafka.internal:9092
group_id: myapp
Consume — a component method per topic, JSON value decoded for you:
from pico_ioc import component
from pico_kafka import kafka_consumer
@component
class OrderProjection:
@kafka_consumer("orders")
async def on_order(self, message: dict):
...
@kafka_consumer("orders", group_id="analytics") # independent fan-out
def on_order_analytics(self, message: dict):
...
Produce — stubs, like a pico-httpx client:
from pico_kafka import kafka_producer, produce
@kafka_producer
class OrderEvents:
@produce("orders")
def order_created(self, message): ...
Semantics:
- Consumers and producers run on a dedicated background loop — works in sync scripts, FastAPI apps and workers alike, no lifespan wiring.
- Each record resolves its component through the container (prototype scope = fresh instance per record).
- A record whose handler raises is logged and skipped — offsets advance, a poison record cannot stall the partition.
- Sync produce stubs block until the broker acks; async stubs await it. Everything stops with the container.
Documentation
Full documentation: https://dperezcabrera.github.io/pico-kafka/
Built for AI-assisted development
pico-kafka is part of an ecosystem designed for humans and coding agents building software together. Every package ships AGENTS.md working conventions, an llms.txt machine-readable docs index and documented behaviour pinned by regression tests; pico-testing gives agents a verification loop for their own changes, and releases are gated by the whole ecosystem booting together against real infrastructure. The full story: Built for AI-assisted development.
Install the agent skills for Claude Code or OpenAI Codex:
curl -sL https://raw.githubusercontent.com/dperezcabrera/pico-skills/main/install.sh | bash
The pico-conventions skill teaches the assistant this module's API surface and invariants; /add-component and /add-tests scaffold components and tests that use it.
License
MIT
Metadata
Release files for pico-kafka 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pico_kafka-0.1.6.tar.gz | 28.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pico_kafka-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.3 kB
Release files / pico_kafka-0.1.6.tar.gz
| Download URL | pico_kafka-0.1.6.tar.gz |
|---|---|
| Size | 28.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0360d8fb9f23ac04f4751c565f6faaec126fee6a23b315ae89897a74948cfdd1
|
|
BLAKE2b-256 checksum How to use checksums |
ad7b06bfb06f2c6ca4c9c9159fdffaaed74ee39eaee1b042a3142e338732fa7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / pico_kafka-0.1.6-py3-none-any.whl
| Download URL | pico_kafka-0.1.6-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9c9b7e85ff6f0483236bd1afd5abedfaccb6fee9dc3468ef01f3d19f75ea86d
|
|
BLAKE2b-256 checksum How to use checksums |
0ccb2b15a93da69763259da9f2e442ebd04e76b2e56ac968f130fd9f656e77d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency log