Skip to main content
Latest Version Latest version Documentation Status https://img.shields.io/badge/license-BSD3-blue.svg

Kafka serialize python library

Kser is a bundle of python library whose purpose is to serialize tasks to be executed on Kafka consumers. It supports farious extensions:

Transport

librdkafka

You can choose to use the C bindings using confluent-kafka:

$ pip install kser[confluent]

kafka-python

You can choose the pure python library kafka-python:

$ pip install kser[pykafka]

http

There is also a light version using HTTP ideal to produce messages (not recommended for consumption)

$ pip install kser[http]

dummy

There is a dummy version for tests, no additional import required, just use / patch with the dummy module.

Other

encrypt data

It is possible to encrypt messages in the Kafka queue using libsodium.

$ pip install kser[crypto]

prometheus exporter

You can export metrics using the prometheus format:

$ pip install kser[prometheus]

A few set of environment variables allow to manage the exporter:

Environment variable

Default value

KSER_METRICS_ENABLED

no

KSER_METRICS_ADDRESS

0.0.0.0

KSER_METRICS_PORT

8888

The exporter has only 2 metrics defined by default, it’s just a sample. A good way to implement your own is to override the triggers methods (prefixed with ‘_’) like the following example:

from kser import KSER_METRICS_ENABLED
from prometheus_client import Counter
from kser.entry import Entrypoint

MY_METRIC = Counter('kser_my_metric', 'a usefull metric')


class MyEntrypoint(Entrypoint):
    def _run(self):
        if KSER_METRICS_ENABLED == "yes":
            MY_METRIC.inc()

        return self.run()

See also:

prometheus_client documentation

Documentation of the python Prometheus client

opentracing support

You can use opentracing with Jaeger to follow operation and task:

$ pip install kser[opentracing]

Configuration can be set using environment variable:

Environment variable

Default value

JAEGER_HOST

localhost

See also:

Opentracing support with Jaeger

Kser documentation

Add-ons

Requirements

  • Python 3.x

Documentations

License

Licensed under BSD 3-Clause License or https://opensource.org/licenses/BSD-3-Clause.

Metadata

Release files for kser 0.8.28

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kser 0.8.28
File Size Uploaded Provenance Actions
kser-0.8.28.tar.gz 15.5 kB Without provenance Details for kser-0.8.28.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kser 0.8.28
File Interpreter ABI Platform Actions
kser-0.8.28-py3-none-any.whl Python 3 none any Details for kser-0.8.28-py3-none-any.whl

Total release size: 37.2 kB

Release files / kser-0.8.28.tar.gz

Download URL kser-0.8.28.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a315f00278a994f21393151a94cb240b1e2cc7978b7e53273a73b6785f9941cd
BLAKE2b-256 checksum
How to use checksums
eee20894d1425f542b14b8977631207bda2dd530b7ab3dd7650b9bbff8e3ea10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / kser-0.8.28-py3-none-any.whl

Download URL kser-0.8.28-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4ddcdad9beb5d7b3a2cb3759ebbecfff35823d5df7de1666bb462f669d442eb
BLAKE2b-256 checksum
How to use checksums
04392b4a23f171a3f0165c938d0c3454ba1aa8f1c47de1543353dc9b17c282de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for kser 0.8.28

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.28 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page