Skip to main content

A Python client for the Absurd SQL-based durable execution workflow system

Project description

WARNING:

DEPRECATED: This package is deprecated and is no longer maintained. Please consider using alternative solutions for your workflow management needs.

Absurd Python Client

A Python client for the Absurd SQL-based durable execution workflow system. This library provides a Python interface to interact with Absurd's PostgreSQL-based task queue and workflow engine.

Installation

pip install absurd

Quick Start

import psycopg
from absurd_client import AbsurdClient

# Create a client instance
client = AbsurdClient(queue_name="my_queue")

# Connect to your PostgreSQL database and spawn a task
with psycopg.connect("your_connection_string") as conn:
    # Spawn a new task
    task_id, run_id, workflow_run_id = client.spawn_task(
        conn=conn,
        task_name="process_data",
        params={"input": "data"}
    )

    print(f"Spawned task: {task_id}")

    # Claim and process tasks
    claimed_tasks = client.claim_task(conn)
    for task_data in claimed_tasks:
        run_id, task_id, attempt, task_name, params, *_ = task_data

        try:
            # Process the task
            result = {"processed": params}
            
            # Mark as completed
            client.complete_task(conn, run_id, result)
            print(f"Task {task_id} completed successfully")
        except Exception as e:
            # Mark as failed
            client.fail_task(conn, run_id, str(e))
            print(f"Task {task_id} failed: {e}")

Highway DSL Integration

The highway-dsl package provides a Python-based domain-specific language for defining complex workflows that fully supports Absurd:

from highway_dsl import WorkflowBuilder, RetryPolicy
from datetime import timedelta

# Create a workflow with Highway DSL
workflow = (
    WorkflowBuilder("data_pipeline")
    .task("extract", "etl.extract_data", result_key="raw_data")
    .task("transform", "etl.transform_data", args=["{{raw_data}}"], result_key="transformed_data")
    .task("load", "etl.load_data", args=["{{transformed_data}}"])
    .build()
)

# Export to YAML for use with Absurd
print(workflow.to_yaml())

Features

  • Task queuing and processing
  • Event-driven workflow coordination
  • Checkpoint-based state management
  • Retry strategies and failure handling
  • Workflow run tracking
  • Connection pooling for production environments
  • Support for complex workflow patterns

Configuration

The client supports the following environment variables:

  • ABSURD_DEFAULT_QUEUE: Default queue name (default: absurd_default)
  • ABSURD_WORKER_ID: Default worker ID (default: absurd_worker_1)

Support

For support, please open an issue in the GitHub repository.

DISCLAIMER

This package has no affiliation with the original Absurd project or its maintainers. It is an independent implementation designed to work with the Absurd system. Use at your own risk. Also this package is not approved or endorsed by the original Absurd project or its maintainers. I built this as part of HIGHWAY workflow engine, but decided not to use Absurd in the end due to various limitations and issues I encountered in its design and implementation.

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

absurd-0.1.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

absurd-0.1.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file absurd-0.1.0.tar.gz.

File metadata

  • Download URL: absurd-0.1.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for absurd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3959000fd1eb3f4bb8114f654cd97f44bfbf01dca5fe8a35ddbf618107091f29
MD5 b91f43d026d91a3082554e20c6653283
BLAKE2b-256 01ac46dd46585199184c78070fc8e0ac790eaa972f541fb1aafd14225c3d50f7

See more details on using hashes here.

File details

Details for the file absurd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: absurd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for absurd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 973e7cd4840dc088d8399616052420ae70bf1cc73f92535f7352e06ca4da73bc
MD5 8a7a15bc282074bff132f65e61fa524d
BLAKE2b-256 6bc42d6dd75c46e21e8ec47d788067cf21cdcc8accba6a6d6a732888d777d7ed

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