{"id":21399311,"url":"https://github.com/streamr-dev/streamr-client-python","last_synced_at":"2025-07-13T20:33:25.752Z","repository":{"id":56147940,"uuid":"163869208","full_name":"streamr-dev/streamr-client-python","owner":"streamr-dev","description":"Python library for accessing Streamr API","archived":false,"fork":false,"pushed_at":"2022-12-27T15:33:41.000Z","size":150,"stargazers_count":8,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-10T16:51:11.962Z","etag":null,"topics":["client-library","decentralized","decentralized-web","json","pubsub","python","realtime","realtime-messaging","streamr","streamr-client","web3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streamr-dev.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":"2019-01-02T17:17:15.000Z","updated_at":"2025-01-08T19:56:08.000Z","dependencies_parsed_at":"2023-01-31T04:16:46.483Z","dependency_job_id":null,"html_url":"https://github.com/streamr-dev/streamr-client-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/streamr-dev/streamr-client-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fstreamr-client-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fstreamr-client-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fstreamr-client-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fstreamr-client-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamr-dev","download_url":"https://codeload.github.com/streamr-dev/streamr-client-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fstreamr-client-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265200062,"owners_count":23726765,"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":["client-library","decentralized","decentralized-web","json","pubsub","python","realtime","realtime-messaging","streamr","streamr-client","web3"],"created_at":"2024-11-22T15:14:04.424Z","updated_at":"2025-07-13T20:33:25.439Z","avatar_url":"https://github.com/streamr-dev.png","language":"Python","readme":"# This library has been deprecated. \n\n## Authenticating with an API key has been deprecated. \n\n## Support for email/password authentication will be dropped in the future and cryptographic keys/wallets will be the only supported method.\n\n## Streamr-Client-Python\n\nBy using this client, you can easily interact with the [Streamr](http://www.streamr.com) API from python environments. You can, for example, subscribe to real-time data in Streams, produce new data to Streams, and create new Streams.\n\nThis library is work-in-progress\n\n\n### Installation\n\n1. download\n\n2. `cd streamr-client-python`\n\n3. `pip install .` \n\n### Tests\nYou can test the integration functions using the following steps.\n\n`client_test.py`:  you can run following commands to test.\n\n```\n$ cd streamr-client-python\n$ pytest\n```\n\n### Usage\n\nHere are some quick examples.\n\n#### Importing streamr-client-python module\n\n```\nfrom streamr import Client, Option\n```\n\n#### Creating a StreamrClient instance with given option\n\n```\noption = Option.get_default_option()\noption.api_key = 'your-api-key'\noption.auto_connect = False\noption.auto_disconnect = False\nclient = Client(option)\n```\n#### getting or creating a stream by name\n\n```\nstream = client.get_or_create_stream('stream-test')\n\n```\n\n#### getting the stream id\n\n```\nstream_id = stream[0]['id']\n\n```\n\n#### getting stream by stream_name or stream_id\n\n```\nstream = client.get_stream_by_name('stream-test')\n```\n```\nstream = client.get_stream_by_id(stream_id)\n``` \n\n#### checking the state of connection\n\n```\nprint(client.connection.state)\n```\n\n#### connect to server\n\n```\nclient.connect()\nwhile(not client.is_connected()):\n    pass\n```\n\n#### Subscribing to stream\n```\ndef callback(msg,_):\n\tprint('message received . The Content is : %s'%(msg))\n\nsubscription = client.subscribe(stream_id, callback)\n```\n\n\n#### publishing data to stream\n\n```\nimport time\ndata = [{\"name\":'google',\"age\":19},{\"name\":\"yahoo\",\"age\":11},{\"name\":\"facebook\",\"age\":13},{\"name\":\"twitter\",\"age\":1}]\nstream_id = 'your stream ID'\nfor d in data:\n    client.publish(subscription, d)\n    time.sleep(0.01)\n```\n\n#### disconnect from server\n\n```\nclient.disconnect()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamr-dev%2Fstreamr-client-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamr-dev%2Fstreamr-client-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamr-dev%2Fstreamr-client-python/lists"}