Registry / communication / stream-python

stream-python

JSON →
library5.4.0pypypi✓ verified 21d ago

Client for getstream.io, enabling developers to build scalable newsfeeds and activity streams. The library provides functionality to interact with Stream's API for feed management, activity posting, and user token generation. Currently at version 5.4.0, it maintains an active development pace with several releases per year, including minor updates and occasional major feature additions.

pip install stream-python
INSTALL
IMPORT
SIG · STREAM-PYTHON
S
stream-python
communicationpythonv5.4.0
Install
4.8s avg
Import
Disk
33MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 33.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.8s · import 0.000s · 35MB
33MB installed
● package 33MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

connect
from stream import connect
import stream

Connects to the Stream API using environment variables for credentials, initializes a user feed, adds a simple activity, and then retrieves it to confirm.

import stream import os # Get your API key and secret from getstream.io/dashboard STREAM_API_KEY = os.environ.get('STREAM_API_KEY', 'YOUR_STREAM_API_KEY') STREAM_API_SECRET = os.environ.get('STREAM_API_SECRET', 'YOUR_STREAM_API_SECRET') # Connect to the Stream API client = stream.connect(STREAM_API_KEY, STREAM_API_SECRET) # Get a user feed user_feed = client.feed('user', 'john-doe') # Add an activity to the feed activity_data = { 'actor': 'john-doe', 'verb': 'post', 'object': '1', 'foreign_id': 'post:1', 'message': 'Hello world from Stream!' } response = user_feed.add_activity(activity_data) print(f"Activity added: {response['id']}") # Read activities from the feed (optional, for demonstration) activities = user_feed.get(limit=1)['results'] if activities: print(f"Retrieved activity: {activities[0]['message']}")
Debug
Known issues
breakingVersion 5.0.0 dropped support for Python 3.5. Ensure your environment uses Python 3.6 or newer (3.7+ recommended).
fix
Upgrade your Python interpreter to 3.7 or higher.
affects: >=5.0.0
breakingVersion 5.0.1 introduced a breaking change by bumping the `pyjwt` dependency to version 2.x. If you have other dependencies requiring `pyjwt==1.x`, this might cause conflicts.
fix
Upgrade `pyjwt` to 2.x (`pip install 'pyjwt>=2,<3'`) or ensure your dependency tree allows for `pyjwt` 2.x.
affects: >=5.0.1
breakingIn version 4.0.0, the `create_user_session_token` method was removed and replaced with `create_user_token`. Calls to the old method will fail.
fix
Replace all calls to `client.create_user_session_token(...)` with `client.create_user_token(...)`.
affects: >=4.0.0
gotchaWhen handling JWT tokens, especially if generating them manually or interacting with older systems, be aware that `stream-python`'s token generation methods (e.g., `create_user_token`) now use `pyjwt` 2.x internally. This affects the default algorithms and parameters.
fix
Refer to the `pyjwt` 2.x documentation for any custom token handling or ensure you use the library's provided `create_user_token` method for compatibility.
affects: >=5.0.1
Upgrade
Version history
5.4.0latest on PyPI · released Oct 1, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
stream-python — pip install stream-python · libregistry