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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kser-0.8.27.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kser-0.8.27-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file kser-0.8.27.tar.gz.

File metadata

  • Download URL: kser-0.8.27.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kser-0.8.27.tar.gz
Algorithm Hash digest
SHA256 2deb7f93c3927528812c69a7509ac8f2234d183fa9293f0fd098727a0844b490
MD5 1f63cafca328ca0d297fdad19e5fa4c4
BLAKE2b-256 0af738db4a9e3311bccbc59dd665b0f0862617d69427c1e29186a851fbf5d91f

See more details on using hashes here.

File details

Details for the file kser-0.8.27-py3-none-any.whl.

File metadata

  • Download URL: kser-0.8.27-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kser-0.8.27-py3-none-any.whl
Algorithm Hash digest
SHA256 abfb6fbc18b6579ab3444756b435089506455b791c49a37e1f7a997e64aac18c
MD5 2825c8af11b99c7604bbacefba0ca1db
BLAKE2b-256 12069b8ecc8f690ad1406733d75ff8d37b830d94a56a4c370038f7a3cde28fda

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.27 This release

2 files

0.8.26

1 file

0.8.25

1 file

0.8.24

1 file

0.8.23

1 file

0.8.22

1 file

0.8.21

1 file

0.8.20

1 file

0.8.19

1 file

0.8.18

1 file

0.8.17

1 file

0.8.16

1 file

0.8.15

1 file

0.8.14

1 file

0.8.13

1 file

0.8.12

1 file

0.8.11

1 file

0.8.10

1 file

0.8.9

1 file

0.8.8

1 file

0.8.7

1 file

0.8.6

1 file

0.8.5

1 file

0.8.4

1 file

0.8.3

1 file

0.8.2

1 file

0.8.1

1 file

0.7.9

1 file

0.7.8

1 file

0.7.7

1 file

0.7.6

1 file

0.7.5

1 file

0.7.4

1 file

0.7.3

1 file

0.7.2

1 file

0.7.1

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

0.5.3

1 file

0.5.2

1 file

0.5.1

1 file

0.5.0

1 file

0.4.4

1 file

0.4.3

1 file

0.4.2

1 file

0.4.1

1 file

0.3.14

1 file

0.3.13

1 file

0.3.12

1 file

0.3.11

1 file

0.3.10

1 file

0.3.9

1 file

0.3.8

1 file

0.3.6

1 file

0.3.5

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.10

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.1

1 file

0.1.0

1 file

0.0.3

1 file

0.0.2

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page