Skip to main content

Coflux Python SDK

Project description

Coflux Python SDK

The Coflux Python SDK provides decorators and utilities for defining workflows and tasks.

Installation

pip install coflux

Or for development:

cd adapters/python
poetry install

Usage

Defining Tasks and Workflows

from coflux import task, workflow, log_info

@task()
def process_item(item_id: int) -> dict:
    log_info("Processing item {id}", id=item_id)
    return {"id": item_id, "status": "done"}

@workflow()
def batch_process(items: list[int]) -> list[dict]:
    results = []
    for item_id in items:
        result = process_item(item_id)
        results.append(result)
    return results

CLI Commands

The SDK is invoked by the Go CLI via subprocess:

# Discovery - find all @task/@workflow targets
python -m coflux discover myapp.workflows myapp.tasks

# Execution - run as executor process
python -m coflux execute

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

coflux-0.9.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

coflux-0.9.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file coflux-0.9.0.tar.gz.

File metadata

  • Download URL: coflux-0.9.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coflux-0.9.0.tar.gz
Algorithm Hash digest
SHA256 5f2931d56f152dcc3ceb200bc7be36e25306e254147bf182c1ed94ddf091f2b8
MD5 cd61ec80ad956f6840f3fd3db8f0d402
BLAKE2b-256 f72cc6714de7955a6cb70b227c351a15c4db7e1eedd906be4efab9651f2c7747

See more details on using hashes here.

Provenance

The following attestation bundles were made for coflux-0.9.0.tar.gz:

Publisher: release.yml on bitroot/coflux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coflux-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: coflux-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coflux-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6be7a0296aae34e8c61558c3bd4a78d7f9b37c6ff41eed2bed3746414e9b766
MD5 909c073bd67fcfc875ed7206b49ba394
BLAKE2b-256 2b4a724435ebb201ae10e6418ec8f7e66a0eff82a36769659f966a5b4cc8735e

See more details on using hashes here.

Provenance

The following attestation bundles were made for coflux-0.9.0-py3-none-any.whl:

Publisher: release.yml on bitroot/coflux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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