Skip to main content

EventFlows

A lightweight, robust, and privacy-first server-side tracking library for Python.

EventFlows acts as a universal router for your conversion events. You define your tracking event once, and EventFlows automatically cleans it, hashes sensitive PII, batches it in a background thread, and safely dispatches it to multiple external APIs (Meta, GA4, Reddit, TikTok) without slowing down your main application.


Key Features

  • Zero Latency: Events are dropped into a thread-safe memory queue instantly. Your users never wait for a tracking pixel to load.
  • Privacy by Design: Emails and phone numbers are automatically normalized and SHA-256 hashed before they ever leave your server.
  • Smart Payload Mapping: Send custom data freely. EventFlows dynamically formats it for "Open" APIs (like Meta) and strictly filters it for "Rigid" APIs (like Reddit).
  • Destination Filtering: Choose exactly which networks receive which events.
  • Resilient Networking: Built-in exponential backoff and retry logic for network blips or rate limits.

Installation

Currently, EventFlows is installed from source.

Using Poetry

poetry add git+https://github.com/YOUR_USERNAME/EventFlows.git

Using pip

pip install git+https://github.com/YOUR_USERNAME/EventFlows.git

Quickstart

Register your providers once at the start of your application, then use tracker.track anywhere.

import logging
from EventFlows import tracker, EventType
from EventFlows import ConsoleProvider, MetaProvider, RedditProvider, GA4Provider

# Setup logging to see EventFlows processing in the background
logging.basicConfig(level=logging.INFO)

# 1. Register your destinations (Providers)
tracker.add_provider(ConsoleProvider())  # Great for local debugging
tracker.add_provider(MetaProvider(pixel_id="123", access_token="abc"))
tracker.add_provider(GA4Provider(measurement_id="G-123", api_secret="abc"))

# 2. Track an event anywhere in your app
# This happens instantly. Hashing and API calls occur in a background thread.
tracker.track(
    name="ProSubscription",
    event_type=EventType.PURCHASE,
    user_data={
        "email": "  User@Example.com  ",  # Automatically trimmed, lowercased, and SHA-256 hashed
        "ip_address": "192.168.1.1"
    },
    properties={
        "value": 49.99,
        "currency": "USD",
        "plan_type": "annual"
    },
    event_id="ORD-9999"  # Used for server-side deduplication
)

# 3. Graceful Shutdown
# Essential for ensuring the memory queue is flushed before the process exits.
# Call this in your app's shutdown/cleanup hook.
tracker.shutdown()

Why use tracker.shutdown()?

EventFlows uses an internal queue to batch events and keep your application fast. If your script or server exits abruptly without calling shutdown(), events still in the queue may not be delivered.

  • FastAPI/Starlette: Use the @app.on_event("shutdown") decorator (or lifespan context manager).
  • Flask: Use atexit.register(tracker.shutdown).
  • Scripts: Call it as the final line of your execution.

Metadata

Release files for eventflows 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eventflows 0.1.1
File Size Uploaded Provenance
eventflows-0.1.1.tar.gz 12.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for eventflows 0.1.1
File Interpreter ABI Platform
eventflows-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.6 kB

Release files / eventflows-0.1.1.tar.gz

Download URL eventflows-0.1.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c4aa8f332cfd522e89507ad1ba66aa160ff48b4d639c3216000871e2ff50dd87
BLAKE2b-256 checksum
How to use checksums
c0359149022e0c3fb3b4598be60dc99ebf95b18f11fe6fa0fdc3f197f101e55d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / eventflows-0.1.1-py3-none-any.whl

Download URL eventflows-0.1.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b370ca7c020e8380f6aab68189691b9735a23dc380098c97d30171aa85421efc
BLAKE2b-256 checksum
How to use checksums
b5b5f81427a209aff2eb6e4ff5bd6a0c6575ce09364a336c5c9a43ce2128f935
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for eventflows 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page