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.0.9.tar.gz (8.2 MB view details)

Uploaded Source

Built Distribution

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

absurd-0.0.9-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for absurd-0.0.9.tar.gz
Algorithm Hash digest
SHA256 d7142531745744202f77e25ed4d3d6925bbdedf8a6de48bbb97db7a9f960d217
MD5 e86506abffd9165480a5fdd35d76149f
BLAKE2b-256 eb3d92341897e1d93ab33c947010bb77a7b164b57e55cc5c0440c8b3d6b7656b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: absurd-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 21.5 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.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3a644a6ae383d4efccbc6fd6f3fba6cb63001954d699b17d190465e4139c7192
MD5 3edae41e12ed619a8bf1ac627865c306
BLAKE2b-256 a212586c05258200a10b587e70427c3bac225c4e3683c38d34a412e1e4398aea

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