# 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+.
## 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": "pravega",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "streaming,client,pravega",
"author": "Pravega Community",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/cf/6b/4b0b08296944fc0f4533eb54871488f3699f2e74ade992ed716ba3f82849/pravega-0.3.8.tar.gz",
"platform": null,
"description": "# 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+.\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.8",
"project_urls": {
"Source Code": "https://github.com/pravega/pravega-client-python"
},
"split_keywords": [
"streaming",
"client",
"pravega"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "976e8681a257ec8f5d44ea89d361b65d2be371077d48bd8fd46a3aaf08341c4c",
"md5": "b2f6e8fde9cdfee34077dbc0a3f802f4",
"sha256": "4bdf0bfa0b1f1689587424e84c11f8cb4a8a5e6d6b80883ce1ded7109ab894b8"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp310-cp310-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "b2f6e8fde9cdfee34077dbc0a3f802f4",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 7223734,
"upload_time": "2024-02-26T05:55:41",
"upload_time_iso_8601": "2024-02-26T05:55:41.103369Z",
"url": "https://files.pythonhosted.org/packages/97/6e/8681a257ec8f5d44ea89d361b65d2be371077d48bd8fd46a3aaf08341c4c/pravega-0.3.8-cp310-cp310-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ae91212b08b6ce670f4932a43b70c573be8866d13e801d4b11ccbd5bd235920a",
"md5": "177602678fa5503bc5e08ede6981a0f7",
"sha256": "929c99c2a51ba6bf85d0c806728fdc0193b17db56e16e1af47ce49451f6cb943"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp310-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "177602678fa5503bc5e08ede6981a0f7",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 5993720,
"upload_time": "2024-02-26T05:56:50",
"upload_time_iso_8601": "2024-02-26T05:56:50.830081Z",
"url": "https://files.pythonhosted.org/packages/ae/91/212b08b6ce670f4932a43b70c573be8866d13e801d4b11ccbd5bd235920a/pravega-0.3.8-cp310-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3d4b7922fe8c22222927a14ff13fdc0a43ce50759b7ca3d536557cffb4c40bd0",
"md5": "551f44b7a05fa4fa99b1941a207ea8c2",
"sha256": "eb6e923d60c7e39e2c68ab7b84d92817a25fbb9cdf3d7809f4cda18b4c425b72"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp311-cp311-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "551f44b7a05fa4fa99b1941a207ea8c2",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 7223929,
"upload_time": "2024-02-26T06:00:40",
"upload_time_iso_8601": "2024-02-26T06:00:40.607465Z",
"url": "https://files.pythonhosted.org/packages/3d/4b/7922fe8c22222927a14ff13fdc0a43ce50759b7ca3d536557cffb4c40bd0/pravega-0.3.8-cp311-cp311-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "890c9560fda4926d5a45c645995708d8ab465eefa9ca6a2f444915a65c1f7591",
"md5": "2361bd5007412f021352b9289b70e89d",
"sha256": "f762f75441488364dc2ba3fd3e00bc499c921773e73d53196183c318cde4bbab"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp311-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "2361bd5007412f021352b9289b70e89d",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 5993726,
"upload_time": "2024-02-26T05:56:52",
"upload_time_iso_8601": "2024-02-26T05:56:52.063779Z",
"url": "https://files.pythonhosted.org/packages/89/0c/9560fda4926d5a45c645995708d8ab465eefa9ca6a2f444915a65c1f7591/pravega-0.3.8-cp311-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "089e7ef6c3261a3d713082f636d1b65bc6ad25fffef60ffd8d14d5cd3b9f445a",
"md5": "de45c06e57c9d80645af743781a43a8b",
"sha256": "eac96075976906bc2a29eb807223f6e105df193d5a013477fe04b40e38fe3fea"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp37-cp37m-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "de45c06e57c9d80645af743781a43a8b",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 7222711,
"upload_time": "2024-02-26T05:54:38",
"upload_time_iso_8601": "2024-02-26T05:54:38.245803Z",
"url": "https://files.pythonhosted.org/packages/08/9e/7ef6c3261a3d713082f636d1b65bc6ad25fffef60ffd8d14d5cd3b9f445a/pravega-0.3.8-cp37-cp37m-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "673d68a632799ccae9f4eb990ae3e3a3007cd050ad1fa34ebfc5c35a1329d083",
"md5": "ee0d203b3d3c0f84195efd59a872bd4b",
"sha256": "aff1ab580aee22d93c208fd065725d3e493d352d4a3b220ef53d7c273552b082"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp37-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "ee0d203b3d3c0f84195efd59a872bd4b",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 5994339,
"upload_time": "2024-02-26T05:58:43",
"upload_time_iso_8601": "2024-02-26T05:58:43.402845Z",
"url": "https://files.pythonhosted.org/packages/67/3d/68a632799ccae9f4eb990ae3e3a3007cd050ad1fa34ebfc5c35a1329d083/pravega-0.3.8-cp37-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c24e17ced66b179c6b8e527bff0ecdcc78815b3bcfa51e171ff8012e771971b2",
"md5": "0ed188084b20a0cfb333aeb124b4afe2",
"sha256": "a99f0f5f9f8e2eb2413b9387c89fbff675a4f403777fee86ee95eb3654e21a90"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp38-cp38-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "0ed188084b20a0cfb333aeb124b4afe2",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 7222718,
"upload_time": "2024-02-26T05:55:03",
"upload_time_iso_8601": "2024-02-26T05:55:03.425218Z",
"url": "https://files.pythonhosted.org/packages/c2/4e/17ced66b179c6b8e527bff0ecdcc78815b3bcfa51e171ff8012e771971b2/pravega-0.3.8-cp38-cp38-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c5fd0df6f6f749ead902347b8f38b30dc4f6feaa8db3c596b46848282d375c12",
"md5": "d22e256ebd80fa7fd822500751e9a20e",
"sha256": "92bfe3529c8c82a95f3aadf3e1447de4a458d2a76bb7ff7b5e7bea89d1d93b84"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp38-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "d22e256ebd80fa7fd822500751e9a20e",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 5994492,
"upload_time": "2024-02-26T05:56:43",
"upload_time_iso_8601": "2024-02-26T05:56:43.268824Z",
"url": "https://files.pythonhosted.org/packages/c5/fd/0df6f6f749ead902347b8f38b30dc4f6feaa8db3c596b46848282d375c12/pravega-0.3.8-cp38-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f158037a8153a50eef68fd2146cadadb069bc0ea88a56efd06c8b03fc1a112ed",
"md5": "de144487620d41a10e4476546e39eb57",
"sha256": "cb18bebe02f2ab89041aa30eae5b099248fdbb2b27eaa6484404b1a6d67c3dff"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp39-cp39-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "de144487620d41a10e4476546e39eb57",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 7221738,
"upload_time": "2024-02-26T05:58:59",
"upload_time_iso_8601": "2024-02-26T05:58:59.658354Z",
"url": "https://files.pythonhosted.org/packages/f1/58/037a8153a50eef68fd2146cadadb069bc0ea88a56efd06c8b03fc1a112ed/pravega-0.3.8-cp39-cp39-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dae9248ee37b8f4d285aa6faef331ec234d076a853272ab606200ef24c743ad5",
"md5": "283e142c0c782519b27710a5aecc4b18",
"sha256": "58d554986511f8630f4beeb8363c08847ba3d1b86646de25e028d267ec570abe"
},
"downloads": -1,
"filename": "pravega-0.3.8-cp39-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "283e142c0c782519b27710a5aecc4b18",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 5987113,
"upload_time": "2024-02-26T05:57:38",
"upload_time_iso_8601": "2024-02-26T05:57:38.371466Z",
"url": "https://files.pythonhosted.org/packages/da/e9/248ee37b8f4d285aa6faef331ec234d076a853272ab606200ef24c743ad5/pravega-0.3.8-cp39-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cf6b4b0b08296944fc0f4533eb54871488f3699f2e74ade992ed716ba3f82849",
"md5": "c5626d4fef027925ded5fab4c8e3b3e5",
"sha256": "5b7ba63514265dc28a6415b8085612881c28c4c33124a6d97d2cdc81765fadee"
},
"downloads": -1,
"filename": "pravega-0.3.8.tar.gz",
"has_sig": false,
"md5_digest": "c5626d4fef027925ded5fab4c8e3b3e5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 51755,
"upload_time": "2024-02-26T05:54:40",
"upload_time_iso_8601": "2024-02-26T05:54:40.475307Z",
"url": "https://files.pythonhosted.org/packages/cf/6b/4b0b08296944fc0f4533eb54871488f3699f2e74ade992ed716ba3f82849/pravega-0.3.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-26 05:54:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pravega",
"github_project": "pravega-client-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pytest",
"specs": [
[
"==",
"7.4.4"
]
]
},
{
"name": "pytest-timeout",
"specs": [
[
"==",
"2.2.0"
]
]
},
{
"name": "aiounittest",
"specs": [
[
"==",
"1.4.2"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
"==",
"4.1.0"
]
]
}
],
"tox": true,
"lcname": "pravega"
}