Skip to main content

Jayrun

PyPI version Python Documentation License

Jayrun is a lightweight, artifact-centric Python framework for computational graphs that need iteration, shared resources, hardware placement, supervision, and reliable lifecycle management. Components remain ordinary synchronous or asynchronous Python classes; Jayrun coordinates when they run and who owns their data.

Jayrun fits workloads that need to:

  • iterate an entire graph or repeat one operator;
  • share an expensive model, client, or service across submissions;
  • reserve GPU or atomic multi-device capacity;
  • combine blocking libraries with an application event loop;
  • pause, resume, abort, or stop iteration through one ContextRun API;
  • supervise selected graph contexts from another graph;
  • retain declared results while releasing intermediate data;
  • apply retry, failure, and shutdown 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. Runtime values and configuration are supplied separately for each submission.

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


class ScaleData(BaseOperator):
    def __init__(self, *, data, outputs, name=None, description=None):
        super().__init__(name=name, description=description)
        self.data = ArtifactField(required=True)
        self.factor = ConfigField(value_type=int, required=True)
        self.outputs = (ArtifactField(required=True),)

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


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

artifacts = ArtifactContext(graph=graph)
artifacts.set({data: 7})
configs = ConfigContext(graph=graph)
configs.set({scale.factor: 3})

with Engine() as engine:
    run = engine.submit(artifacts, configs)
    run.wait(timeout=10)
    print(run.artifact(data).value)  # 21

Engine.submit() returns a stable ContextRun. Calling run.wait() waits until the context is finalized, so retained artifacts and the terminal report are ready. The same object exposes live state and lifecycle control while work is active, then stored values and retained ArtifactResults after completion. Applications that need to distinguish unsuccessful terminal outcomes can inspect run.state and run.report.failure before reading an artifact.

Public API

Graph construction and execution:

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

Focused APIs:

from jayrun.context import ArtifactResult, ContextRun, 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

Modules under jayrun.core and jayrun.engine are implementation details.

Documentation

Read the documentation for the conceptual model, operational guidance, and complete tutorials:

Project status

Jayrun is under active development. Public APIs may still be refined 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.

Metadata

Release files for jayrun 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jayrun 0.2.0
File Size Uploaded
jayrun-0.2.0.tar.gz 108.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jayrun 0.2.0
File Interpreter ABI Platform
jayrun-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 268.2 kB

Release files / jayrun-0.2.0.tar.gz

Download URL jayrun-0.2.0.tar.gz
Size 108.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bfb11e10f9e3c4a86aeff233d917d3b0de0230b0c2cabd4a4981517421b81875
BLAKE2b-256 checksum
How to use checksums
1937820fe5b473a5ff12712f359d8013481efbccc48153e8d856866ecdcb7787
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 1, 2026.

Transparency log

Release files / jayrun-0.2.0-py3-none-any.whl

Download URL jayrun-0.2.0-py3-none-any.whl
Size 159.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fa79b0ce1ea6a8f8a3add564d22536237baf232ef70a45de42ce0243d3e6c95
BLAKE2b-256 checksum
How to use checksums
c4f481da8eb31f227bdfdb3ac77ce13c7b0420ca825002244e638708d5137dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release 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