PYPI PACKAGE AUDIT
v0.4.0
Enterprise Healthy
potik
An async Python framework for exactly-once Kafka services.
905
/ 1000
Quick Install
pip install potik
1. Governance
150/200
2. PEP Metadata
200/200
3. Security
200/200
4. Docs & SEO
155/200
5. CI Engineering
200/200
📣 Share Audit:
Share this report and visual preview in the current language
PYPI TELEMETRY
Downloads & Community Adoption
Last 30 days (without mirrors)
Last 7 days
208
Last 30 days
746
Total (180 days)
746
Health & Engineering Analysis (5 Pillars)
1. Governance & Community150 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✓ 50 pts
CONTRIBUTING.md✓ 50 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. PEP Metadata & Packaging200 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✓ 50 pts
3. Security & Supply Chain200 / 200 ▾
Zero CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✓ 50 pts
Snyk / Audit Link✓ 40 pts
HTTPS Repository✓ 50 pts
4. Documentation, SEO & Ecosystem155 / 200 ▾
Structured README✓ 60 pts
Read the Docs✓ 50 pts
Django Packages✕ 0 pts
Website / Technical Articles✓ 45 pts
5. Engineering, CI & Quality200 / 200 ▾
Automated Tests✓ 65 pts
GitHub Actions CI✓ 65 pts
CHANGELOG.md✓ 35 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✓ 35 pts
README & DOCS
PyPI Metadata v0.4.0
Official Documentation & Usage Guide — potik
Show full original documentation (English README) ▾
potik
potik is an async Python framework for Kafka services that read records, process them, and write new ones. A handler returns its output records, and potik commits them in one Kafka transaction with the input's offset. Consumers downstream see each output exactly once, even after a crash or a rebalance.
[!WARNING] potik is alpha. Its API can change between minor versions until 1.0.
Example
from typing import Annotated
import anyio
from pydantic import BaseModel
import potik
from potik import Config, Key, ProducerRecord, Router, Topic
from potik.serde import PydanticJson
class Order(BaseModel):
sku: str
amount: float
class Accepted(BaseModel):
sku: str
total: float
json = PydanticJson()
orders = Topic("orders", Order, serde=json)
accepted = Topic("orders.accepted", Accepted, serde=json)
router = Router()
@router.handler(orders)
async def accept(order: Order, customer: Annotated[str, Key()]) -> ProducerRecord:
return accepted(Accepted(sku=order.sku, total=order.amount * 1.2), key=customer)
runtime = potik.build_runtime(Config(bootstrap_servers="localhost:9092", group_id="acceptor"), [router])
anyio.run(runtime.run)
Features
- One transactional producer per app commits outputs and offsets for all partitions together (KIP-447).
- Partitions run concurrently, and records within a partition run in order, or with key concurrency, in order per key. A handler can run for minutes without dropping the app from its consumer group.
- A
Topicdeclares its value and key types, and type checkers check every record a handler returns. - Handlers take dependencies in the style of FastAPI's
Depends, e.g. a database transaction that commits or rolls back after each record. - A failing handler stops only its own partition. Middleware adds retries and dead letter topics.
- The app shuts down on SIGTERM after it commits finished work. Its liveness and readiness checks are ready to serve as Kubernetes probes from any HTTP framework.
- OpenTelemetry tracing follows each record through its handler, and its outputs to the transaction that commits them.
Install
potik needs Python 3.12+ and Kafka 4.0+.
uv add "potik[pydantic]"
Documentation
- Quickstart
- Runtime: delivery, failures, configuration, and production
- Middleware: retries, dead letters, concurrency limits, tracing, and metrics
- Typed API: topics, serdes, handlers, and testing
- Producer and request-reply
To contribute, see CONTRIBUTING.md.