{"id":18975044,"url":"https://github.com/bufferapp/kiner","last_synced_at":"2025-04-15T06:55:32.893Z","repository":{"id":47373580,"uuid":"97851634","full_name":"bufferapp/kiner","owner":"bufferapp","description":"Python AWS Kinesis Producer with error handling and thread support.","archived":false,"fork":false,"pushed_at":"2022-10-05T23:12:32.000Z","size":38,"stargazers_count":45,"open_issues_count":1,"forks_count":20,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-15T06:55:25.793Z","etag":null,"topics":["aws","kinesis-producer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bufferapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-20T15:32:29.000Z","updated_at":"2024-07-11T01:11:19.000Z","dependencies_parsed_at":"2022-09-07T22:10:52.332Z","dependency_job_id":null,"html_url":"https://github.com/bufferapp/kiner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fkiner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fkiner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fkiner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fkiner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bufferapp","download_url":"https://codeload.github.com/bufferapp/kiner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023713,"owners_count":21199958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","kinesis-producer"],"created_at":"2024-11-08T15:17:08.247Z","updated_at":"2025-04-15T06:55:32.874Z","avatar_url":"https://github.com/bufferapp.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg width=35% src=\"https://user-images.githubusercontent.com/1682202/40414884-c84a4248-5e79-11e8-9df4-e7d1da89ed92.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ci\u003eA simple Python AWS Kinesis Producer.\u003c/i\u003e\n\u003c/p\u003e\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \n\n[![Build Status](https://travis-ci.org/bufferapp/kiner.svg?branch=master)](https://travis-ci.org/bufferapp/kiner)\n[![PyPI version](https://badge.fury.io/py/kiner.svg)](https://badge.fury.io/py/kiner)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)\n\n\n### Features\n\n- Error handling and retrying with exponential backoff\n- Automatic batching and flush callbacks\n- Threaded execution\n\nInspired by the AWS blog post [Implementing Efficient and Reliable Producers with the Amazon Kinesis Producer Library](https://aws.amazon.com/blogs/big-data/implementing-efficient-and-reliable-producers-with-the-amazon-kinesis-producer-library/).\n\n## Installation\n\nYou can use `pip` to install Kiner.\n\n```bash\npip install kiner\n```\n\n## Usage\n\nTo use Kiner, you'll need to have AWS authentication credentials configured\nas stated in the [`boto3` documentation](https://boto3.readthedocs.io/en/latest/guide/quickstart.html#configuration)\n\n```python\nfrom kiner.producer import KinesisProducer\n\np = KinesisProducer('stream-name', batch_size=500, max_retries=5, threads=10)\n\nfor i in range(10000):\n    p.put_record(i)\n\np.close()\n```\n\nTo be notified when data is flushed to AWS Kinesis, provide a flush_callback\n```python\nfrom uuid import uuid4\nfrom kiner.producer import KinesisProducer\n\ndef on_flush(count, last_flushed_at, Data=b'', PartitionKey='', Metadata=()):\n    print(f\"\"\"\n        Flushed {count} messages at timestamp {last_flushed_at}\n        Last message was {Metadata['id']} paritioned by {PartitionKey} ({len(Data)} bytes)\n    \"\"\")\n\np = KinesisProducer('stream-name', flush_callback=on_flush)\n\nfor i in range(10000):\n    p.put_record(i, metadata={'id': uuid4()}, partition_key=f\"{i % 2}\")\n\np.close()\n\n```\n## Contributions\n\n- Logo design by [@area55git](https://github.com/area55git)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fkiner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbufferapp%2Fkiner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fkiner/lists"}