![CIbuild](https://github.com/pravega/pravega-client-rust/workflows/CIbuild/badge.svg)
[![codecov](https://codecov.io/gh/pravega/pravega-client-rust/branch/master/graph/badge.svg?token=XEjqMkINCV)](https://codecov.io/gh/pravega/pravega-client-rust)
# Pravega Python client.
This project provides a way to interact with [Pravega](http://pravega.io) using Python client.
Pravega is an open source distributed storage service implementing Streams. It offers Stream as the main primitive for
the foundation of reliable storage systems: a high-performance, durable, elastic, and unlimited append-only byte stream
with strict ordering and consistency.
This project supports interaction with Pravega for Python versions 3.8+. For a quick tutorial on the Python bindings
visit the [book](https://pravega.github.io/pravega-client-rust/Python/PythonBindings.html).
Also check out the Pravega Python client [API documents](https://pravega.github.io/pravega-client-rust/python/pravega_client.html).
## Install
The client library can be installed using pip.
```shell
pip install pravega
```
The users can also choose to generate the bindings using the commands specified at [PythonBinding](./PythonBinding.md) .
## Example
### Write events
```python
import pravega_client
# assuming Pravega controller is listening at 127.0.0.1:9090
stream_manager = pravega_client.StreamManager("tcp://127.0.0.1:9090")
scope_result = stream_manager.create_scope("scope_foo")
self.assertEqual(True, scope_result, "Scope creation status")
stream_result = stream_manager.create_stream("scope_foo", "stream_bar", 1) # initially stream contains 1 segment
self.assertEqual(True, stream_result, "Stream creation status")
writer = stream_manager.create_writer("scope_foo","stream_bar")
writer.write_event("hello world")
```
### Read events
```python
import pravega_client
# assuming Pravega controller is listening at 127.0.0.1:9090
stream_manager = pravega_client.StreamManager("tcp://127.0.0.1:9090")
reader_group = stream_manager.create_reader_group("my_reader_group", "scope_foo", "stream_bar")
reader = reader_group.create_reader("my_reader");
# acquire a segment slice to read
slice = await reader.get_segment_slice_async()
for event in slice:
print(event.data())
# after calling release segment, data in this segment slice will not be read again by
# readers in the same reader group.
reader.release_segment(slice)
# remember to mark the finished reader as offline.
reader.reader_offline()
```
Raw data
{
"_id": null,
"home_page": "",
"name": "saipravega",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "streaming,client,pravega",
"author": "Pravega Community",
"author_email": "",
"download_url": "",
"platform": null,
"description": "![CIbuild](https://github.com/pravega/pravega-client-rust/workflows/CIbuild/badge.svg)\n[![codecov](https://codecov.io/gh/pravega/pravega-client-rust/branch/master/graph/badge.svg?token=XEjqMkINCV)](https://codecov.io/gh/pravega/pravega-client-rust)\n\n# Pravega Python client.\n\nThis project provides a way to interact with [Pravega](http://pravega.io) using Python client.\n\nPravega is an open source distributed storage service implementing Streams. It offers Stream as the main primitive for \nthe foundation of reliable storage systems: a high-performance, durable, elastic, and unlimited append-only byte stream \nwith strict ordering and consistency.\n\nThis project supports interaction with Pravega for Python versions 3.8+. For a quick tutorial on the Python bindings \nvisit the [book](https://pravega.github.io/pravega-client-rust/Python/PythonBindings.html).\n\nAlso check out the Pravega Python client [API documents](https://pravega.github.io/pravega-client-rust/python/pravega_client.html).\n## Install\n\nThe client library can be installed using pip.\n```shell\npip install pravega\n```\nThe users can also choose to generate the bindings using the commands specified at [PythonBinding](./PythonBinding.md) .\n\n## Example\n### Write events\n```python\nimport pravega_client\n# assuming Pravega controller is listening at 127.0.0.1:9090\nstream_manager = pravega_client.StreamManager(\"tcp://127.0.0.1:9090\")\n\nscope_result = stream_manager.create_scope(\"scope_foo\")\nself.assertEqual(True, scope_result, \"Scope creation status\")\n\nstream_result = stream_manager.create_stream(\"scope_foo\", \"stream_bar\", 1) # initially stream contains 1 segment\nself.assertEqual(True, stream_result, \"Stream creation status\")\n\nwriter = stream_manager.create_writer(\"scope_foo\",\"stream_bar\")\nwriter.write_event(\"hello world\")\n```\n### Read events\n```python\nimport pravega_client\n# assuming Pravega controller is listening at 127.0.0.1:9090\nstream_manager = pravega_client.StreamManager(\"tcp://127.0.0.1:9090\")\n\nreader_group = stream_manager.create_reader_group(\"my_reader_group\", \"scope_foo\", \"stream_bar\")\n\nreader = reader_group.create_reader(\"my_reader\");\n\n# acquire a segment slice to read\nslice = await reader.get_segment_slice_async()\nfor event in slice:\n print(event.data())\n \n# after calling release segment, data in this segment slice will not be read again by\n# readers in the same reader group.\nreader.release_segment(slice)\n\n# remember to mark the finished reader as offline.\nreader.reader_offline()\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Pravega client",
"version": "0.3.4",
"project_urls": {
"Source Code": "https://github.com/kotlasaicharanreddy/pravega-client-rust"
},
"split_keywords": [
"streaming",
"client",
"pravega"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5f7ff00412941722bc7cd685924159eff814eba359a88940f8cfc0d53a821bd7",
"md5": "c01f9d83c8873e456866c6ef28ecda1b",
"sha256": "0da4c4e0765b04b3b8c57dd7081376f5a24821d299926f32866d83e2f4680931"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp310-cp310-macosx_10_7_x86_64.whl",
"has_sig": false,
"md5_digest": "c01f9d83c8873e456866c6ef28ecda1b",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 5910287,
"upload_time": "2023-06-12T08:08:44",
"upload_time_iso_8601": "2023-06-12T08:08:44.112257Z",
"url": "https://files.pythonhosted.org/packages/5f/7f/f00412941722bc7cd685924159eff814eba359a88940f8cfc0d53a821bd7/saipravega-0.3.4-cp310-cp310-macosx_10_7_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0ba64615427478bbbeab9f22fe25f619bc39cdaaac756a2c3564622a2d80c655",
"md5": "7ad648afa1f7c2f0a6455b974636139f",
"sha256": "59725707b5c349b07cfe8692693ac277e4893e7e1e785777f5106598a4ec6024"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp310-cp310-manylinux_2_35_x86_64.whl",
"has_sig": false,
"md5_digest": "7ad648afa1f7c2f0a6455b974636139f",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 6313540,
"upload_time": "2023-06-12T07:52:30",
"upload_time_iso_8601": "2023-06-12T07:52:30.307548Z",
"url": "https://files.pythonhosted.org/packages/0b/a6/4615427478bbbeab9f22fe25f619bc39cdaaac756a2c3564622a2d80c655/saipravega-0.3.4-cp310-cp310-manylinux_2_35_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "52d2feb7fc1b23d9dfde8a3f0e97f985370f964dd78c27c29bbec2c59722ff55",
"md5": "795006fe8ae63af9aef3429a2ba2bddf",
"sha256": "dc25c5dc66a65d6490e6a4b6a6cb2498267d28e6cd8dbf9d38f34598e5d7cce1"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp310-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "795006fe8ae63af9aef3429a2ba2bddf",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 5726117,
"upload_time": "2023-06-12T07:58:13",
"upload_time_iso_8601": "2023-06-12T07:58:13.912466Z",
"url": "https://files.pythonhosted.org/packages/52/d2/feb7fc1b23d9dfde8a3f0e97f985370f964dd78c27c29bbec2c59722ff55/saipravega-0.3.4-cp310-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dccd4700ebb90470f343e0cc8e0fd9fed485c22ac476df7efd2bf92d9c8f7f3c",
"md5": "fd513f99ceb5993d6a7478e7d1ab22e8",
"sha256": "99ad682fd69c2b10f44c3dfd051aa9206a757ebc1f84175bb7f050fe08a9b0b8"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp37-cp37m-macosx_10_7_x86_64.whl",
"has_sig": false,
"md5_digest": "fd513f99ceb5993d6a7478e7d1ab22e8",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 5910646,
"upload_time": "2023-06-12T08:07:23",
"upload_time_iso_8601": "2023-06-12T08:07:23.684131Z",
"url": "https://files.pythonhosted.org/packages/dc/cd/4700ebb90470f343e0cc8e0fd9fed485c22ac476df7efd2bf92d9c8f7f3c/saipravega-0.3.4-cp37-cp37m-macosx_10_7_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0c18a76918c613f83daa7a82e898c0ddd4c7bf577b7159aeb86b81d18810d9ed",
"md5": "80c1df3f71758876d79814f7d4fcae1f",
"sha256": "df84f629030a38f9ff4223b11af8f692ad964d394c34ada9f839dfc12e89fbcb"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp37-cp37m-manylinux_2_35_x86_64.whl",
"has_sig": false,
"md5_digest": "80c1df3f71758876d79814f7d4fcae1f",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 6313964,
"upload_time": "2023-06-12T07:51:50",
"upload_time_iso_8601": "2023-06-12T07:51:50.908038Z",
"url": "https://files.pythonhosted.org/packages/0c/18/a76918c613f83daa7a82e898c0ddd4c7bf577b7159aeb86b81d18810d9ed/saipravega-0.3.4-cp37-cp37m-manylinux_2_35_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7520c9eacdc4c387a8ec2e9a73d5d3aaf34ed7b4a7671755938a70bd97f10f5d",
"md5": "383736ff615097edd9b2cba0b9ae15c2",
"sha256": "bc749c2b795faadd0e1486430f90e7a24daa552e06c1f54b71cd38d0bed3da2d"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp37-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "383736ff615097edd9b2cba0b9ae15c2",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 5727116,
"upload_time": "2023-06-12T07:59:58",
"upload_time_iso_8601": "2023-06-12T07:59:58.563741Z",
"url": "https://files.pythonhosted.org/packages/75/20/c9eacdc4c387a8ec2e9a73d5d3aaf34ed7b4a7671755938a70bd97f10f5d/saipravega-0.3.4-cp37-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ddb7fbe1a66ab0fdc47049024687cc5e3f739005ad3b20d40933aa1b64c68716",
"md5": "0d6fe3795b6146b5148ff02b3e9fae94",
"sha256": "e71a2b48440cad1857e2a73f7f402e63d37d9e256a942c235b2f601867948b68"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp38-cp38-macosx_10_7_x86_64.whl",
"has_sig": false,
"md5_digest": "0d6fe3795b6146b5148ff02b3e9fae94",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 5910636,
"upload_time": "2023-06-12T08:01:36",
"upload_time_iso_8601": "2023-06-12T08:01:36.909506Z",
"url": "https://files.pythonhosted.org/packages/dd/b7/fbe1a66ab0fdc47049024687cc5e3f739005ad3b20d40933aa1b64c68716/saipravega-0.3.4-cp38-cp38-macosx_10_7_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "95071b144556ce71b65994003981533a38296173a79531f7852589ab3a7c6d20",
"md5": "30b33aa6da4591f8fef0ddb876d7a6f9",
"sha256": "899c70aa4f6fbe79e7e9a99e1a35724efeaae4ea9f0949cf600147a03f4867cc"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp38-cp38-manylinux_2_35_x86_64.whl",
"has_sig": false,
"md5_digest": "30b33aa6da4591f8fef0ddb876d7a6f9",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 6313949,
"upload_time": "2023-06-12T07:55:05",
"upload_time_iso_8601": "2023-06-12T07:55:05.851557Z",
"url": "https://files.pythonhosted.org/packages/95/07/1b144556ce71b65994003981533a38296173a79531f7852589ab3a7c6d20/saipravega-0.3.4-cp38-cp38-manylinux_2_35_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "276cb7a4eee1a854243c2e41f176eda6e96918de316d252909bbcce7c0e33804",
"md5": "ebaf6f6cd97f5efe0a3fda13bb90df1e",
"sha256": "b8ae9d9e15df0117112bf8316a570be8ed644543254dc0f0299dac43e9b56474"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp38-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "ebaf6f6cd97f5efe0a3fda13bb90df1e",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 5727173,
"upload_time": "2023-06-12T07:56:57",
"upload_time_iso_8601": "2023-06-12T07:56:57.670562Z",
"url": "https://files.pythonhosted.org/packages/27/6c/b7a4eee1a854243c2e41f176eda6e96918de316d252909bbcce7c0e33804/saipravega-0.3.4-cp38-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3b16f3daec80bc7bffafe28a25162dddf147fcb8bccf21b82ecffc6126322709",
"md5": "712d911234054b43a3456eedb7824e06",
"sha256": "d6c633faecaaa5cad88153a63309918956b067e099c55fbf008fd52aa7d0b8e6"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp39-cp39-macosx_10_7_x86_64.whl",
"has_sig": false,
"md5_digest": "712d911234054b43a3456eedb7824e06",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 5910748,
"upload_time": "2023-06-12T08:07:33",
"upload_time_iso_8601": "2023-06-12T08:07:33.639962Z",
"url": "https://files.pythonhosted.org/packages/3b/16/f3daec80bc7bffafe28a25162dddf147fcb8bccf21b82ecffc6126322709/saipravega-0.3.4-cp39-cp39-macosx_10_7_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fab93cb1570c78633c0e8a8d71e6ffc6748168ce49430812bc3837acab783bcb",
"md5": "4fccc9925542284fa675bcf8b59108c3",
"sha256": "4fd3404198c5844cabfb52e3196e6003bf22b9aa14dad8e2a66b397f424d8a97"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp39-cp39-manylinux_2_35_x86_64.whl",
"has_sig": false,
"md5_digest": "4fccc9925542284fa675bcf8b59108c3",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 6313871,
"upload_time": "2023-06-12T07:53:44",
"upload_time_iso_8601": "2023-06-12T07:53:44.832419Z",
"url": "https://files.pythonhosted.org/packages/fa/b9/3cb1570c78633c0e8a8d71e6ffc6748168ce49430812bc3837acab783bcb/saipravega-0.3.4-cp39-cp39-manylinux_2_35_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c6d0deb79ab7bfa34ce5862ffe017b24705d557190525f627b17c8130180bb82",
"md5": "ad7fca59d37a741c4758e9e6fca10c73",
"sha256": "bc5d5c154408ca58181daceee91d1fff5f53f442533d7567a4748056eb559bcc"
},
"downloads": -1,
"filename": "saipravega-0.3.4-cp39-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "ad7fca59d37a741c4758e9e6fca10c73",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 5727072,
"upload_time": "2023-06-12T07:55:15",
"upload_time_iso_8601": "2023-06-12T07:55:15.912259Z",
"url": "https://files.pythonhosted.org/packages/c6/d0/deb79ab7bfa34ce5862ffe017b24705d557190525f627b17c8130180bb82/saipravega-0.3.4-cp39-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-12 08:08:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kotlasaicharanreddy",
"github_project": "pravega-client-rust",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "saipravega"
}