Skip to main content

logo

Effortless Task Management: Flexible, Fast, Simple and Reliable

Overview

Taskade is a Python framework designed to simplify the execution of tasks with dependencies. It provides a flexible and efficient way to manage task execution, allowing developers to focus on writing task logic rather than managing dependencies.

Features

  • High Performance: Optimized for speed and efficiency.
  • Easy to Use: Simple and intuitive API.
  • Lightweight: Taskade has no dependencies on anything outside of the standard library.
  • Flexible Execution: Choose from various execution strategies, including sequential, concurrent, and asynchronous execution.
  • CGraphLib: An optional dependency written for Taskade cgraphlib. With up to a ~2.5x performance improvement over the standard library.

Design Principles

Taskade is designed with the following principles in mind:

  • Separation of Concerns: Task logic is separate from execution logic.
  • Flexibility: Support for various execution strategies and task types.
  • Efficiency: Optimize task execution for performance.

Use Cases

Taskade is suitable for applications that require:

  • Complex Task Dependencies: Manage complex task dependencies with ease.
  • High-Performance Execution: Execute tasks concurrently for improved performance.
  • Asynchronous Tasks: Support for asynchronous tasks and execution.

Getting Started

Install Taskade

pip install taskade

cgraphlib

cgraphlib is a C extension that provides a more performant graph traversal algorithm and is also available on versions of python that don't support the graphlib providing a ~2.5x performance improvement

Basic Usage

To create a Task, the simplest way is through the @task decorator:

from taskade import task

@task(graph_name='my_graph')
def my_task():
    # Task implementation
    return "example_output"

@task(graph_name='my_graph', dependencies=my_task)
def my_second_task():
    # Task implementation
    return "example_output"

@task(graph_name='my_graph')
def my_third_task():
    # Task implementation
    return "example_output"

@task(graph_name="my_graph", dependencies=(my_second_task, my_third_task))
def my_final_task(dependent_result)
    print(dependent_result)
    return "final_example_output"

Using the decorator automatically creates a Graph and allows it to be executed.

from taskade import get_graph

def main():
    results = get_graph("my_graph")() # Call the execution of the graph
    print(results[my_task]) # Prints `example_output`
    print(results[my_final_task]) # Prints `final_example_output`

if __name__ == "__main__":
    main()

Combine Sync & Async Tasks

Taskade graphs also allow for mixing async and sync tasks within the same graph. Blocking will occur only when an sync function is executing, but otherwise the same async behavior will be preserved.

from taskade import task

@task(graph_name='my_graph')
async def my_task():
    # Task implementation
    return "example_output"

@task(graph_name="my_graph", dependencies=my_task)
def my_final_task(dependent_result)
    print(dependent_result)

you will still need to execute the graph using await as some of the nodes are async.

from taskade import get_graph
import asyncio

async def main():
    results = await get_graph("my_graph")() # Call the execution of the graph
    print(results[my_task]) # Prints `example_output`
    print(results[my_final_task]) # Prints `final_example_output`

if __name__ == "__main__":
    asyncio.run(main())

Documentation

The above are just the basics of using Taskade, there is a lot more functionality provdided that can be found in the documentation.

Metadata

Release files for taskade 0.0.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 taskade 0.0.1
File Size Uploaded
taskade-0.0.1.tar.gz 19.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for taskade 0.0.1
File
taskade-0.0.1-cp311-cp311-manylinux_2_35_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.35+ x86-64 Details
taskade-0.0.1-cp310-cp310-manylinux_2_35_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.35+ x86-64 Details
taskade-0.0.1-cp39-cp39-manylinux_2_35_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.35+ x86-64 Details
taskade-0.0.1-cp38-cp38-manylinux_2_35_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.35+ x86-64 Details

Total release size: 173.5 kB

Release files / taskade-0.0.1.tar.gz

Download URL taskade-0.0.1.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a4d06a04821dd7d7ebb7bf8f25ac5940d0004c0d4590fc0e6d2423e44cdec034
BLAKE2b-256 checksum
How to use checksums
bad64bf20317c0a062453fffb63cd14974909bc6d90d550fc523e991437143f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / taskade-0.0.1-cp311-cp311-manylinux_2_35_x86_64.whl

Download URL taskade-0.0.1-cp311-cp311-manylinux_2_35_x86_64.whl
Size 39.0 kB
Tags CPython 3.11 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
f883ccd97e58bc7d0cd2c949d0b8a332d85d2975835c7b0886227c425e68bdff
BLAKE2b-256 checksum
How to use checksums
eef63ebcf895a157023bc37dae95be09a4c16e3f296d486ffcc04b0997791065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / taskade-0.0.1-cp310-cp310-manylinux_2_35_x86_64.whl

Download URL taskade-0.0.1-cp310-cp310-manylinux_2_35_x86_64.whl
Size 38.2 kB
Tags CPython 3.10 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
515f224bcacf8fb5463a4af068ac664b68e00d49172df14e84be112ade931543
BLAKE2b-256 checksum
How to use checksums
d1887be55fe99734828f5d0e9d9e473b501668f25a40c7739dac3423711afe87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / taskade-0.0.1-cp39-cp39-manylinux_2_35_x86_64.whl

Download URL taskade-0.0.1-cp39-cp39-manylinux_2_35_x86_64.whl
Size 38.0 kB
Tags CPython 3.9 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
eed721a97fb80372f468e73d06e75bb79080a17648e0d0c2a9b443a884f0319d
BLAKE2b-256 checksum
How to use checksums
fae5fd29fad6d437166cfac84899014bcc920822fc6a523e9935767e6f85c9a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / taskade-0.0.1-cp38-cp38-manylinux_2_35_x86_64.whl

Download URL taskade-0.0.1-cp38-cp38-manylinux_2_35_x86_64.whl
Size 38.8 kB
Tags CPython 3.8 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
d15484b73f2c73102cd6ec98ae2b4665f6bf56c05d16a257ca073919b0ac92b8
BLAKE2b-256 checksum
How to use checksums
f5bd6ac142e5d2ef89b9b2ef821b127d26477a73ff983dcdf2077d9dc4e63017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

5 release files

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