Skip to main content

Kinesis utilities

Project description

PyPI

Miscellaneous utilities for AWS Kinesis.

Installation

pip install kinesisutils

To install the development version:

pip install git+https://github.com/findhotel/kinesisutils

Usage

At the moment there is only one utility implemented: a Python generator that reads records from a Kinesis stream. You can use it like this:

import json

from kinesisutils import KinesisGenerator

# Hit Kinesis with at most 10 requests per second, usin json.loads to
# deserialize the Kinesis records (the default). You could deactivate record
# deserialization by setting des=None.
kg = KinesisGenerator("stream_name", rqs=10, des=json.loads)

for rec in kg:
    print(rec)

By default the generator will keep pulling records from Kinesis for 60 seconds. You can customize this timeout if you want:

from kinesisutils import KinesisGenerator

kg = KinesisGenerator("stream_name", timeout=30)

for rec in kg:
    print(rec)

Contact

If you have questions, bug reports, suggestions, etc. please create an issue on the GitHub project page. PRs are also welcome.

License

This software is licensed under the MIT license.

See License file.

© 2017 German Gomez-Herrero, Find Hotel and others.

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

kinesisutils-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file kinesisutils-0.0.2.tar.gz.

File metadata

File hashes

Hashes for kinesisutils-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9e472b6da77c8220caf34acc705fb51afce0fb5fc596820efdb864e9ed76346b
MD5 9a69bc37e84b57e4e09897545ee84699
BLAKE2b-256 af8c7e1b106d3a1cb4bbdc5c15e877ebbb5b905b4ecdcbd75bf537b869e1391e

See more details on using hashes here.

Supported by

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