Skip to main content

Jayrun

PyPI version Python Documentation License

Jayrun is an artifact-centric Python execution framework for computational graphs that need more than one-pass task scheduling. It coordinates data flow, iteration, shared resources, hardware placement, supervision, failure containment, and shutdown while keeping application components ordinary Python classes.

Jayrun is useful when a workload must do one or more of the following:

  • iterate a graph or repeat selected operators;
  • share expensive runtime resources safely across submissions;
  • reserve CPU, GPU, or atomic multi-device capacity;
  • combine synchronous and asynchronous operators;
  • inspect, pause, resume, or abort contexts, and stop graph iteration;
  • supervise several contexts from another context;
  • retain declared results while clearing intermediate data;
  • apply retry and failure policies consistently.

Installation

Jayrun requires Python 3.11 or later.

python -m pip install jayrun

Optional integrations are installed only when an application needs them:

python -m pip install "jayrun[yaml]"      # YAML configuration loading
python -m pip install "jayrun[plotting]"  # Interactive validation graphs

A complete first graph

An artifact declares data flowing through a graph. An operator declares how that data is consumed and produced. Runtime values are supplied separately for each submission.

from jayrun import (
    Artifact,
    ArtifactContext,
    ArtifactField,
    ArtifactFlow,
    BaseOperator,
    ConfigContext,
    ConfigField,
    Engine,
    GraphDefinition,
)
from jayrun.context import ContextState


class ScaleData(BaseOperator):
    def __init__(
        self,
        *,
        data: Artifact,
        outputs: tuple[Artifact | None, ...],
        name: str | None = None,
    ) -> None:
        super().__init__(name=name)
        self.data = ArtifactField(required=True)
        self.factor = ConfigField(value_type=int, required=True)
        self.outputs = (ArtifactField(required=True),)

    def execute(self) -> object:
        return self.data.value * self.factor.value


data = Artifact(name="data")
scale = ScaleData(data=data, outputs=(data,), name="scale_data")
data_flow = ArtifactFlow(scale, artifact=data)
graph = GraphDefinition(data_flow, entry_flows=(data_flow,))

artifacts = ArtifactContext(graph=graph)
artifacts.set({data: 7})

configs = ConfigContext(graph=graph)
configs.set({scale.factor: 3})

with Engine() as engine:
    context_id = engine.submit(artifacts, configs)
    snapshot = engine.wait(context_id)

if snapshot is None or snapshot.state is not ContextState.FINISHED:
    raise RuntimeError("the context did not finish successfully")

print(snapshot.artifact(data).value)  # 21

The graph definition is reusable. Each submission receives its own artifact values, configuration, settings, records, and lifecycle state.

Core ideas

Concept Purpose
Artifact Declares data identity and flow through a graph
Operator Transforms artifacts or performs a terminal side effect
Resource Shares a runtime-managed value or capability safely
Context Isolates one graph submission and its lifecycle
Placement Reserves execution capacity on CPU or accelerator devices
Supervisor Lets running workflows observe and control other contexts

Graph-building primitives are imported from jayrun:

from jayrun import Artifact, ArtifactContext, ArtifactField, ArtifactFlow
from jayrun import BaseOperator, BaseResource, ConfigContext, ConfigField
from jayrun import Data, Engine, GraphDefinition, ResourceField

Focused public APIs are grouped by purpose:

from jayrun.context import ArtifactResult, ContextSnapshot, ContextState
from jayrun.placement import Backend, Device, Placement, PlacementGroup
from jayrun.properties import DTypeProperty, ShapeProperty, TypeProperty
from jayrun.settings import ArtifactPolicy, ContextSettings, EngineSettings
from jayrun.validation import GraphValidator

Internal jayrun.core.* and jayrun.engine.* modules are implementation details and are not supported import paths.

Documentation

Read the documentation for the conceptual model, complete tutorials, operational guidance, and API reference.

Recommended starting points:

Project status

Jayrun 0.1.0 is an alpha release. Its public APIs are documented, but compatibility may change before 1.0 when a clearer or safer contract requires it. Report bugs and request features through GitHub Issues.

License

Jayrun is licensed under the Apache License 2.0.

Copyright 2026 Masoud Yavari.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jayrun-0.1.0.tar.gz (105.2 kB view details)

Uploaded Source

Built Distribution

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

jayrun-0.1.0-py3-none-any.whl (156.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jayrun-0.1.0.tar.gz
  • Upload date:
  • Size: 105.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jayrun-0.1.0.tar.gz
Algorithm Hash digest
SHA256 57aa9637e6702454e8d422b75aa9dc3f6f67110626dbfe7f579ba9a7693ff4fd
MD5 984eeb2ba73e67ae2f2f407d85cee32d
BLAKE2b-256 9b810aad1c4596a0009f8fd11b942718bfb34100baba7bdbd4705c36be396b1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for jayrun-0.1.0.tar.gz:

Publisher: publish.yml on jayrun-project/jayrun

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

File details

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

File metadata

  • Download URL: jayrun-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 156.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jayrun-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25b9f041fe6a6475e76ed2f3ef5f1f6f4ae25d7bf67de07cd8add7c111fd67a2
MD5 57b4956aa9d9363aa624d43dd64975a2
BLAKE2b-256 0794efdd922439f665599ee06ddc37caac05902754085a8833fc67e32e6459ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for jayrun-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jayrun-project/jayrun

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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