Skip to main content

Structured async workflows for Python with fluent API patterns

Project description

🚀 FlowKitX - Simplify Async Workflows

PyPI version Python 3.8+ License: MIT Tests

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

Why FlowKitX?

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 (FlowKitX):

@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 flowkitx

📦 Installation

pip install flowkitx

🔧 How FlowKitX Works

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

import flowkit

# FlowKitX 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.

🏆 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}))

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 FlowKitX

FlowKitX 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

FlowKitX 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 FlowKitX Compares

Feature FlowKitX aiohttp httpx requests
Fluent API
Type Safe
Sessions
Pipelines

FlowKitX provides structured async workflows with minimal overhead.

📋 License

MIT License - see LICENSE file for details.

🤝 Contributing

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


🚀 Try FlowKitX today for cleaner async workflows:

pip install flowkitx

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

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

flowkitx-0.1.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

flowkitx-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file flowkitx-0.1.1.tar.gz.

File metadata

  • Download URL: flowkitx-0.1.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for flowkitx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7bc89f5aec4365ce2ab27356f2c3805261e968b07d16f67d4608fb2efb316e26
MD5 4a8d3383249bed461b2c4fde2af3ad6d
BLAKE2b-256 f75f9db1ceb8032cacec630a1581b2d7f31a8386ca6a1ebc83ad19718c4a7aab

See more details on using hashes here.

File details

Details for the file flowkitx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: flowkitx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for flowkitx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a210a877fc25853bb8d2575ca10ec79fe36b98b427e5e1379246a17adde1dac5
MD5 edd5351c705b045c849fdefc9a251918
BLAKE2b-256 8d57cf82fccee4bad3448a6d65fe8b0ef75c96fce7b57717af4bc63da3577f37

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