Skip to content

About

Python Client - Build Activity Feeds & Streams with GetStream.io

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

52 Commits

Folders and files

Repository files navigation

stream-python

image

Coverage Status

stream-python is a Python client for Stream.

Installation

Install from Pypi

pip install stream-python

Usage

# Instantiate a new client
import stream
client = stream.connect('YOUR_API_KEY', 'API_KEY_SECRET')
# Find your API keys here https://getstream.io/dashboard/

# Instantiate a feed object
user_feed_1 = client.feed('user:1')

# Get activities from 5 to 10 (slow pagination)
result = user_feed_1.get(limit=5, offset=5)
# (Recommended & faster) Filter on an id less than 112334
result = user_feed_1.get(limit=5, id_lt=112334)

# Create a new activity
activity_data = {'actor': 1, 'verb': 'tweet', 'object': 1}
activity_response = user_feed_1.add_activity(activity_data)

# Remove an activity by its id
user_feed_1.remove('12345678910')

# Follow another feed
user_feed_1.follow('flat:42')

# Stop following another feed
user_feed_1.unfollow('flat:42')

Docs are available on GetStream.io.

API docs are on Read the docs.

Contributing

First, make sure you can run the test suite. Tests are run via py.test

py.test stream/tests.py
# with coverage
py.test stream/tests.py --cov stream --cov-report html
# against a local API backend
LOCAL=true py.test stream/tests.py

About

Python Client - Build Activity Feeds & Streams with GetStream.io

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages