Skip to main content

A small Python-native DAG task executor with caching.

Project description

Acyro

PyPI Python CI License

English | 简体中文

A small, local, Python-native DAG task runner with deterministic execution and content-aware JSON caching.

Install

pip install acyro

Requires Python 3.12 or newer.

Quick start

from pathlib import Path

from acyro import run, task


@task(inputs=["data/*.txt"], outputs=["build/combined.txt"])
def combine() -> None:
    Path("build").mkdir(exist_ok=True)
    content = "\n".join(path.read_text() for path in Path("data").glob("*.txt"))
    Path("build/combined.txt").write_text(content)


@task(depends=[combine], outputs=["dist/report.txt"])
def report() -> None:
    Path("dist").mkdir(exist_ok=True)
    Path("dist/report.txt").write_text(Path("build/combined.txt").read_text())


run()

run() executes tasks in dependency order. Later runs mark unchanged tasks as SKIPPED.

CLI

Put tasks in a Python file, then run or inspect the graph:

acyro run examples/acyrofile.py
acyro graph examples/acyrofile.py

Cache

Successful tasks are cached under .acyro/cache. Fingerprints include task metadata, source code, input contents, output contents, and dependency fingerprints. Changing an input or dependency invalidates downstream tasks; deleting or modifying an output reruns its task.

Input declarations accept explicit files and Glob patterns. Output declarations must be explicit file paths. Paths are resolved from the current working directory, and file contents are hashed with SHA-256. Missing inputs and outputs raise clear errors without replacing the last successful cache record.

Tasks without inputs or outputs retain the original source- and dependency-based cache behavior. Use run(cache_dir=...) to choose another cache directory.

Acyro is intentionally serial and local. It has no async runtime, distributed workers, database, retries, or pluggable cache backends.

Development

uv sync --extra dev
uv run pytest -q
uv run ruff check .
uv build

Licensed under the MIT License.

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

acyro-0.2.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

acyro-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file acyro-0.2.0.tar.gz.

File metadata

  • Download URL: acyro-0.2.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for acyro-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1f71c5e445cb4dd86fd85258f3ae7a6547eea1807d497ddd7816ea7ac8174072
MD5 84dc49887b5a03b0882dccc5973faee9
BLAKE2b-256 29bd869bf24f5a3d1a728b88c5abe93d9cea6618c490276615ea7c0b4347a94a

See more details on using hashes here.

Provenance

The following attestation bundles were made for acyro-0.2.0.tar.gz:

Publisher: publish.yml on xjn2005/Acyro

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

File details

Details for the file acyro-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: acyro-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for acyro-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e0ee6970ab89d3d0167a632d30a3a832576db540f2e0e3aa0fee4817336a2b1
MD5 0794089e9090f326d925f97cf56821a9
BLAKE2b-256 0e9c7ffaa2d10d1e40d3f2365f2b272342eb95029e7a312174a75a3646ea3e78

See more details on using hashes here.

Provenance

The following attestation bundles were made for acyro-0.2.0-py3-none-any.whl:

Publisher: publish.yml on xjn2005/Acyro

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