explaingit

tschellenbach/stream-framework

4,750PythonAudience · developerComplexity · 4/5Setup · hard

TLDR

Python library for building social activity feeds, news feeds, notification inboxes, and activity histories, using Redis or Cassandra to store and fan out updates to followers at high speed.

Mindmap

mindmap
  root((Stream Framework))
    What it does
      Activity feeds
      Fan-out to followers
      Notification inboxes
    Storage options
      Redis
      Cassandra
      Both combined
    Tech stack
      Python
      Celery background tasks
    Use cases
      News feed
      Notifications
      Activity history
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a Twitter-style news feed showing posts from people a user follows, with fan-out to all followers on each new post.

USE CASE 2

Add a notification inbox to your app that updates in near-real time when others interact with a user's content.

USE CASE 3

Create a personal activity history page showing everything a user has done on your platform.

USE CASE 4

Power a Pinterest-style following feed that pre-computes what each user sees rather than assembling it fresh on each page load.

Tech stack

PythonRedisCassandraCelery

Getting it running

Difficulty · hard Time to first run · 1h+

Requires running Redis or Cassandra plus a Celery worker before fan-out works, no built-in queue is included.

In plain English

Stream Framework is a Python library for building the kind of activity feeds you see on social platforms: a news feed showing what people you follow have been doing, a notification inbox, or a personal activity history. Think of the feed on Twitter or the notification bell on Instagram. This library gives you the building blocks to create that kind of system inside your own application. The library stores and retrieves feed data using Redis, Cassandra, or both. Redis is an in-memory data store suited for fast reads and writes on smaller data sets, while Cassandra is a distributed database designed for high-volume production workloads. When you write a new activity, the library fans it out to all the followers of that user using background tasks managed by a separate tool called Celery. The reads are designed to be fast because the feed is already pre-computed, rather than assembled fresh on each page load. The core concepts are activities, feeds, and a manager class. An activity represents something that happened: a user pinned an item, posted a photo, or liked something. A feed is a list of activities stored for a specific user. The manager connects the two, handles the fan-out to followers, and exposes simple methods for your application code to call. The README includes a worked example showing how to broadcast a pin action to all followers in a Pinterest-style app. The README notes that the same authors run a commercial cloud service called Stream, which provides similar functionality without requiring you to run and maintain your own Redis, Cassandra, or Celery infrastructure. The cloud service is free up to three million feed updates and supports several programming languages beyond Python. Stream Framework is installed via pip and requires choosing Redis, Cassandra, or both as optional dependency sets at install time. The README links to documentation and a Pinterest-like example application. The project appears to have stabilized, with the README reflecting the state of the library rather than active new development.

Copy-paste prompts

Prompt 1
I'm building a social app in Python and need a news feed where users see posts from people they follow. Show me how to set up Stream Framework with Redis to define a follow relationship, post a new activity, and fan it out to all followers.
Prompt 2
Using Stream Framework with Cassandra, write Python code to model a like event as an activity, add it to the liker's personal feed, and send a notification to the person whose content was liked.
Prompt 3
Show me how to paginate through a user's news feed using Stream Framework, retrieving 20 activities at a time starting from a given offset or cursor.
Open on GitHub → Explain another repo

← tschellenbach on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.