Skip to main content

A kinesis consumer is purely written in python.

Project description

Kinesis Consumer in Python

A kinesis consumer is purely written in python. This is a lightweight wrapper on top of AWS python library boto3. You also can consume records from Kinesis Data Stream (KDS) via:

  • Lambda function: I have a demo kinesis-lambda-sqs-demo showing how to consume records in a serverless and real-time way.
  • Kinesis Firehose: This is a AWS managed service and easily save records into different sinks, like S3, ElasticSearch, Redshift.

Installation

Install the package via pip:

pip install kcpy

Getting started

from kcpy import StreamConsumer
consumer = StreamConsumer(stream_name)
for record in consumer:
    print(record)

The output would look like:

{
    'ApproximateArrivalTimestamp': datetime.datetime(2018, 11, 13, 11, 57, 55, 117807), 
    'Data': b'Jessica Walter', 
    'PartitionKey': 'Jessica Walter', 
    'SequenceNumber': '1'
}

Features

  • Read records from a stream with multiple shards

Todo

  • Save checkpoint for each shard
  • Rebalance when the number of shards changes
  • Allow kcpy to run on multiple machines

Changelog

0.1.4

  • Pass aws configurations into boto3 client directly.

0.1.3

  • Update the README.

0.1.2

  • Add markdown support for long description.

0.1.1

  • Add a long description.

0.1.0

  • First version of kcpy.

License

Copyright (c) 2018 Hengfeng Li. It is free software, and may be redistributed under the terms specified in the LICENSE file.

Project details


Download files

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

Source Distribution

kcpy-0.1.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

kcpy-0.1.4-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file kcpy-0.1.4.tar.gz.

File metadata

  • Download URL: kcpy-0.1.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for kcpy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9a2f6e489222b883b3b2678b6c9b09ff49092d06dbeff3cb8a7a681336b0ffca
MD5 cb43f3d8abab7bac879532c0c50ed3aa
BLAKE2b-256 807b91ecb90b3c8a4913227ebd1defcf1ed3ea9b8b5df3f3f818c01d01a472d0

See more details on using hashes here.

File details

Details for the file kcpy-0.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: kcpy-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for kcpy-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3995061b839f2d075db81c1b2d46aa27ce1e60b69a416fb231fddb3b46777644
MD5 a1c370db30296e2cedbae8336196f6ab
BLAKE2b-256 e0a62aa2b2bb7068aa82e6e71f0449122f7418c21c0629c97e363e76d837bdec

See more details on using hashes here.

Supported by

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