Skip to main content

LAREX Action SDK

This SDK is work in progress. The public API can still change before LAREX Actions and the SDK are considered stable.

Framework-neutral Python SDK for building LAREX Action processors with signed dispatch verification, typed payloads, and cooperative run cancellation.

The core package verifies LAREX dispatch requests, parses typed run/input payloads, sends heartbeats, downloads selected files, uploads result manifests, and helps processors acknowledge cancellation cleanly. FastAPI support is available as an optional convenience extra.

Installation

uv add "larex-action-sdk[fastapi]"

For framework-neutral usage only:

uv add larex-action-sdk

Quickstart

import os

from larex_actions import ActionContext
from larex_actions.fastapi import create_larex_action_app


async def process(ctx: ActionContext) -> None:
    action_input = await ctx.pull_input()
    total = len(action_input.pages)
    for index, page in enumerate(action_input.pages, start=1):
        await ctx.heartbeat(
            status_message=f"Processing page {index}/{total}: {page.name}",
            raise_on_cancel=True,
        )
        results = ctx.result_builder()
        if page.xml:
            xml_bytes = await ctx.download_bytes(page.xml[0])
            results.add_xml_bytes(
                page_id=page.id,
                content=xml_bytes,
                file_name=f"{page.name}-processed.xml",
            )
        await ctx.submit_page_results(page.id, results, f"Finished {page.name}")

    await ctx.complete(message="Done")


app = create_larex_action_app(
    processor_id="my-processor",
    dispatch_secret=os.environ["LAREX_DISPATCH_HMAC_SECRET"],
    handler=process,
    max_concurrent_runs=1,
)

Documentation

The full guide lives in the LAREX documentation under Processor SDK:

Training, evaluation, and integration processors are described in Dataset Model Training, Dataset Model Evaluation, and Integration Actions.

Development

uv sync --all-extras
uv run ruff format .
uv run ruff check .
uv run pyright
uv run pytest
uv build

Releases are automated by the python-semantic-release workflow. Conventional commits on main determine the next version (feat → minor, fix/perf → patch, and breaking changes → major). The workflow verifies the package, updates pyproject.toml and uv.lock, creates the release commit/tag and GitHub release. Run it manually from the Actions tab when you need to force a bump level or create a prerelease.

Configure a repository secret named RELEASE_TOKEN with a GitHub token that has Contents read/write access. A PAT is required so the generated tag/release triggers the existing PyPI publication workflow. Release candidate tags containing rc publish to TestPyPI; published stable releases publish to PyPI.

Metadata

Release files for larex-action-sdk 0.29.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 larex-action-sdk 0.29.1
File Size Uploaded Provenance Actions
larex_action_sdk-0.29.1.tar.gz 70.3 kB With provenance Details for larex_action_sdk-0.29.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for larex-action-sdk 0.29.1
File Interpreter ABI Platform Actions
larex_action_sdk-0.29.1-py3-none-any.whl Python 3 none any Details for larex_action_sdk-0.29.1-py3-none-any.whl

Total release size: 100.9 kB

Release files / larex_action_sdk-0.29.1.tar.gz

Download URL larex_action_sdk-0.29.1.tar.gz
Size 70.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cc7f7603a5e8d1b482d2341e41fa6b343a3f1f20764b173dc28be62e5e2fcf0f
BLAKE2b-256 checksum
How to use checksums
386db1043ffe2038378f6b9ff874c18ea8dd4578b68f515896986386fad64967
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / larex_action_sdk-0.29.1-py3-none-any.whl

Download URL larex_action_sdk-0.29.1-py3-none-any.whl
Size 30.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d910e586e995f1617ca4a2233b19aa2bec6b149140b86b8e7d38d6af8f8759a8
BLAKE2b-256 checksum
How to use checksums
10bd5c305e4599dd351484aacc83b1e64afbe1151c1e65f9bceca9f3c73d54d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for larex-action-sdk 0.29.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for larex_action_sdk-0.29.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.29.1 This release

2 release files Full provenance

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