Activity Feeds V3 is in closed alpha — do not use it in production (just yet).

Installation

pip install getstream

GitHub repository: https://github.com/GetStream/stream-py. Feel free to submit bug reports and feature requests.

The package is tested against these environments:

  • Python 3.7+
  • Python 3.8+
  • Python 3.9+
  • Python 3.10+
  • Python 3.11+
  • Python 3.12+

To create a client, you’ll need your API key and secret. Both of them can be found in your Stream Dashboard.

You can optionally pass a timeout for the API requests, the default timeout is 6000ms.

import stream

# Create client with default timeout (6000ms)
client = stream.connect('api_key', 'api_secret')

# Or create client with custom timeout (3 seconds)
client = stream.connect('api_key', 'api_secret', timeout=3.0)

# Get the feeds client
feeds_client = client.feeds

# Your feeds operations here...

Alternative initialization

You can also initialize the client using environment variables:

import os
import stream

# Set environment variables
os.environ['STREAM_API_KEY'] = 'your_api_key'
os.environ['STREAM_API_SECRET'] = 'your_api_secret'

# Initialize client from environment
client = stream.connect_from_env()

# Get the feeds client
feeds_client = client.feeds
© Getstream.io, Inc. All Rights Reserved.