Skip to main content

Python Stream Processing Framework

Project description

Python Stream Processing Framework (PSPF)

PSPF is a lightweight, high-performance stream processing framework for Python. It provides Kafka-like semantics (partitions, offsets, consumer groups, exactly-once processing) without requiring Kafka or JVM infrastructure.

It is designed for building event-driven applications, event sourcing systems, and data pipelines that need to be robust, replayable, and easy to deploy.

Note: While the Quick Start below uses Valkey (Redis), PSPF is backend-agnostic! You can also use Kafka, or the local-only Memory and File backends for testing without Docker.

Key Features

  • Valkey-Based Streams: Production-ready stream processing using Valkey (or Redis) as the message broker.
  • Kafka-like Semantics: Partitions, consumer groups, and high-performance throughput.
  • Exactly-Once Semantics: Idempotent processing with built-in deduplication.
  • Partitioned Concurrency: Automatic load balancing across consumer instances.
  • Built-in Observability: Prometheus metrics, Grafana dashboards, and Admin API.
  • Native Event Log (Preview): Lightweight file-based log for local-only use cases.

Installation

pip install .

Quick Start: User Signups

PSPF makes it easy to handle high-volume event streams. Here is a simple processor that handles user signups.

1. Requirements

Ensure you have Valkey (or Redis) running:

docker run -d -p 6379:6379 valkey/valkey:latest

2. Run the Demo

The included valkey_demo.py example demonstrates a producer and consumer running together.

python examples/valkey_demo.py

3. Verification

You will see logs showing events being produced and then consumed with their respective offsets.

How It Works

  1. Producers emit events to a Stream using a specific Backend (e.g., ValkeyStreamBackend).
  2. Workers consume from the stream in Consumer Groups, sharing the load across multiple instances.
  3. Processors handle message batches, providing built-in retries, deduplication, and dead-letter routing.
  4. Observability is baked in; every processed message updates metrics and traces.

Project Structure

pspf/
├── connectors/   # Backend implementations (Valkey, Kafka, Memory)
├── processing/   # Core logic (BatchProcessor, DLO, Retries)
├── state/        # Stateful processing backends (SQLite, etc.)
└── stream.py     # Main Stream facade

Check out the Tutorial for a deeper dive.

Documentation

About the Author

PSPF™ was designed and developed by Joseph Hall.

I built this framework to solve specific challenges in stream processing—focusing on low-latency data handling, simplified deployments without JVM overhead, and ease of use. While my current professional background is in high-volume customer success and sales, my passion lies in engineering robust, scalable Python tools.

🚀 Let's Connect

I am currently looking for my next challenge in Software Engineering, Data Engineering, or DevOps. If you’re looking for a developer who understands both clean code and how to communicate with stakeholders, let’s talk!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pspf-0.1.0a1.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pspf-0.1.0a1-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

Details for the file pspf-0.1.0a1.tar.gz.

File metadata

  • Download URL: pspf-0.1.0a1.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for pspf-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 59008487a3454fc79e7eb985c679b76876bac3d7427014e5f572b8a5e6e4922b
MD5 a7a6d3b53c963b6f6b682cd686c61485
BLAKE2b-256 da70bb975e56963b4aeb5f0284f2161dac95e3bb69fc562ced273eb8b21c1e2a

See more details on using hashes here.

File details

Details for the file pspf-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: pspf-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 46.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for pspf-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 647221ddc5f522e5affc6e8fa50137b719b05b155b70140ff4364d9695995a75
MD5 c980ad8aa8baac6ebc2ed10def048eae
BLAKE2b-256 250d9745758336014706a0feead78c3d2c947e686536dca07acfe3e15df18491

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page