Skip to main content

🚀 FlowKit - Simplify Async Workflows

PyPI version Python 3.8+ License: MIT Tests

FlowKit provides fluent async workflows with lazy execution and minimal boilerplate.

⚡ Why FlowKit?

Before (Traditional Async):

async def fetch_user_data(user_id):
    async with aiohttp.ClientSession() as session:
        async with session.get(f"https://api.example.com/users/{user_id}") as response:
            user = await response.json()
            async with session.get("https://api.example.com/posts", params={"userId": user_id}) as posts_response:
                posts = await posts_response.json()
                return {"user": user, "posts": posts}

After (FlowKit):

@flowkit.simple
def fetch_user_data(user_id):
    user = flowkit.get(f"https://api.example.com/users/{user_id}").json()
    posts = flowkit.get("https://api.example.com/posts", params={"userId": user_id}).json()
    return {"user": user, "posts": posts}

🎯 Key Features

  • 🔗 Fluent API - Chain operations with .pipe() method
  • 🛡️ Type Safe - Full IDE support and type hints
  • 🚀 Modern Foundation - Built on battle-tested httpx
  • 🔧 Framework Ready - FastAPI, Django, Flask examples
  • 📦 Simple Installation - pip install flowkit-async

📦 Installation

pip install flowkit-async

🔧 How FlowKit Works

FlowKit provides lazy async pipelines - operations are queued and executed when awaited.

import flowkit

# FlowKit operations return awaitable Flow objects
user_flow = flowkit.get("https://api.example.com/users/1")
posts_flow = flowkit.get("https://api.example.com/posts")

# Execute both operations
user = await user_flow.json()
posts = await posts_flow.json()

Core Concept: Flow Objects

Flow objects are awaitable pipelines that:

  • Chain operations without immediate execution
  • Execute when awaited in the current event loop
  • Enable fluent, readable async patterns

This is structured async workflows, not sync-to-async magic.

🔧 How FlowKit Works

FlowKit provides lazy async pipelines. API calls return awaitable Flow objects that record operations and execute asynchronously when awaited.

FlowKit does NOT:

  • convert blocking code into async
  • use threads or greenlets
  • bypass the event loop

This is structured async composition, not async magic.

🏆 Real-World Examples

Data Processing Pipeline

@flowkit.simple
def fetch_user_data(user_id: int):
    """Fetch and process user data."""
    return (flowkit.get(f"https://jsonplaceholder.typicode.com/users/{user_id}")
              .json()
              .pipe(lambda user: {**user, "processed": True}))

Note: @flowkit.simple is intended for synchronous functions. If used on async functions, it acts as a pass-through wrapper.

Concurrent Operations

@flowkit.simple
def fetch_dashboard():
    """Fetch multiple data sources concurrently."""
    users = flowkit.get("https://jsonplaceholder.typicode.com/users").json()
    posts = flowkit.get("https://jsonplaceholder.typicode.com/posts").json()
    comments = flowkit.get("https://jsonplaceholder.typicode.com/comments").json()
    
    # These execute concurrently when awaited
    return {"users": users, "posts": posts, "comments": comments}

🛠 When to Use FlowKit

FlowKit is ideal for:

  • API-heavy applications with multiple calls
  • Data pipelines and processing workflows
  • Teams wanting consistent async patterns
  • Rapid prototyping with clean syntax

⚠️ Important Notes

FlowKit does NOT:

  • Block the event loop or use thread pools
  • Make synchronous code magically non-blocking
  • Replace understanding of asyncio fundamentals
  • Work with CPU-bound operations

Always use async/await with CPU-intensive tasks.

🆚 How FlowKit Compares

Feature FlowKit aiohttp httpx requests
Fluent API ✅ ❌ ❌ ❌
Type Safe ✅ ✅ ✅ ✅
Sessions ✅ ✅ ✅ ❌
Pipelines ✅ ❌ ❌ ❌

FlowKit provides structured async workflows with minimal overhead on top of httpx and is comparable in performance for typical I/O-bound workloads.

📋 License

MIT License - see LICENSE file for details.

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.


🚀 Try FlowKit today for cleaner async workflows:

pip install flowkit-async

⭐ Star us on GitHub! github.com/flowkit/flowkit

Metadata

Release files for flowkit-async 1.0.0

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

Source distribution (sdist)

Source distribution for flowkit-async 1.0.0
File Size Uploaded Provenance Actions
flowkit_async-1.0.0.tar.gz 11.8 kB Without provenance Details for flowkit_async-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flowkit-async 1.0.0
File Interpreter ABI Platform Actions
flowkit_async-1.0.0-py3-none-any.whl Python 3 none any Details for flowkit_async-1.0.0-py3-none-any.whl

Total release size: 19.9 kB

Release files / flowkit_async-1.0.0.tar.gz

Download URL flowkit_async-1.0.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4865e168616d86c1fdf5cb4aac14221ee473b73088d54dd7195d0682421c13ae
BLAKE2b-256 checksum
How to use checksums
680b2f3f9e4937d0ef8ef0861d3a2bfc9ee2528c1f6b708c0a22d1881fd8b0b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / flowkit_async-1.0.0-py3-none-any.whl

Download URL flowkit_async-1.0.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aab1d522737ec26c6ac160e1c7871e28e77e5affaf78c7d022e91424b5597c28
BLAKE2b-256 checksum
How to use checksums
7298890db335dd8ec4429c942d5cf008111835b3af2752c7819620d16c12d583
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for flowkit-async 1.0.0

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

1.0.0 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