Registry / serialization / sentry-kafka-schemas

sentry-kafka-schemas

JSON →
library2.1.34pypypi✓ verified 84d ago

Provides Kafka topic definitions, Avro/Protobuf schemas, and versioned schema management for Sentry's event ingestion and processing pipelines. Version 2.1.29 is actively maintained with frequent releases (multiple per month).

pip install sentry-kafka-schemas
INSTALL
IMPORT
SIG · SENTRY-KAFKA-SCHEM
S
sentry-kafka-schemas
serializationpythonv2.1.34
Install
8.7s avg
Import
233ms
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.34 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.244s · 58MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.7s · import 0.222s · 55MB
50MB installed
● package 50MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_topic
from sentry_kafka_schemas import get_topic
from sentry_kafka_schemas.schema import get_topic
get_topic is top-level, not nested in schema module.
get_message_type
from sentry_kafka_schemas import get_message_type
from sentry_kafka_schemas.types import get_message_type
get_message_type is exported from the package root.

Get topic metadata, message type, and schema for a given topic.

from sentry_kafka_schemas import get_topic, get_message_type, get_schema topic_name = "events" topic = get_topic(topic_name) print(topic.version) msg_type = get_message_type(topic_name) print(msg_type) schema = get_schema(topic_name) print(schema.schema_str[:100])
Debug
Known issues
breakingVersion 2.0 removed the old `get_topic_with_version` function and changed how topic versions are specified. Use `get_topic(topic_name, version=...)` instead.
fix
Replace `get_topic_with_version(name, version)` with `get_topic(name, version=version)`.
affects: >=2.0
deprecatedCalling `get_schema` without a version argument will be deprecated. Always pass an explicit version to avoid defaulting to the latest.
fix
Use `get_schema(topic_name, version='2.0')` or similar.
affects: >=1.5
gotchaThe package uses `importlib.resources` internally, which may raise `FileNotFoundError` if the package is installed incorrectly (e.g., via `pip install -e` without proper metadata).
fix
Ensure the package is installed normally (not in editable mode) or install with `--no-use-pep517`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'sentry_kafka_schemas'
Package not installed or installed as a different name (e.g., `sentry-kafka-schemas` vs `sentry_kafka_schemas`).
fix
Install via `pip install sentry-kafka-schemas` and use `import sentry_kafka_schemas` (underscore).
sentry_kafka_schemas.exceptions.TopicNotFoundError: Topic 'some_topic' not found
The topic name does not exist in the schemas registry.
fix
Check the list of valid topics: `from sentry_kafka_schemas import TOPICS; print(TOPICS.keys())`
Upgrade
Version history
2.1.34latest on PyPI · released Jun 17, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
sentry-kafka-schemas — pip install sentry-kafka-schemas · libregistry