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.29

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.29
File Size Uploaded Provenance Actions
kser-0.8.29.tar.gz 15.5 kB Without provenance Details for kser-0.8.29.tar.gz

Built distribution (wheel)

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

Total release size: 37.2 kB

Release files / kser-0.8.29.tar.gz

Download URL kser-0.8.29.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5cd38b6310b14dc8f4936e1d630c5296a5a587a73d4d834c9228285aff62c6e2
BLAKE2b-256 checksum
How to use checksums
d7a424534da4940daf4645d020c3d1e07284e58981a291235695005102634f64
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.29-py3-none-any.whl

Download URL kser-0.8.29-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fac92a395bb23c0311598d1eb249ed0dcf196b0732563c1fb2493b020b1f047
BLAKE2b-256 checksum
How to use checksums
49a298beb933c5cfad860f15970b2bfe9c37862d661b8b3ac7cdec221dc3d2d3
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.29

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.29 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