Skip to main content

Zero-dependency workflow/task/Step/AutoStep annotation markers used by axiom-graph.

Project description

axiom-annotations

Zero-dependency Python package providing the shared annotation vocabulary used by axiom-graph.

Contains:

  • @workflow and @task decorators
  • Step() and AutoStep() inline markers
  • StepValidationError exception
  • Per-marker argument validation helpers

All markers are pure Python with no third-party runtime dependencies. This lets downstream tools annotate their code with workflow/task/Step/AutoStep markers without pulling in any heavier optional runtime stack.

Install

pip install axiom-annotations

Usage

from axiom_annotations import workflow, task, Step, AutoStep

@task(purpose="Load data from file")
def load_data(path: str):
    ...

@workflow(purpose="Run the analysis pipeline")
def run_pipeline(path: str):
    ax = AutoStep(step_num=1)
    data = load_data(path)

    ax = Step(step_num=2, name="Filter", purpose="Remove bad rows")
    data = [r for r in data if r.quality > 0.5]

Registry hook

By default @workflow and @task just validate and pass the function through. Tools that want to collect decorated functions into a registry can install a hook:

from axiom_annotations.decorators import set_register_hook

def my_register(func, *, purpose, kind, inputs, outputs, critical):
    ...  # persist to your own registry

set_register_hook(my_register)

axiom-graph installs such a hook during scanning to populate its index.

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

axiom_annotations-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

axiom_annotations-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: axiom_annotations-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Windows/10

File hashes

Hashes for axiom_annotations-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1f8eaf275205fc1f48a99ca0a255c465a0cdaf69e82caffcb2ce3b1cdae88d9
MD5 28bdf2afafa836599549b7ad246c39d0
BLAKE2b-256 e9c5790d3f7a1275c85615c82efae6873c30f59acaa808abc66215e90df6fab4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: axiom_annotations-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Windows/10

File hashes

Hashes for axiom_annotations-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92234394d96428f380d7ade22f1af7653a7b09e3fb5ea68ab164d43ef0d30279
MD5 63f695ec4496720c7cbe9667104ca1f9
BLAKE2b-256 f0840b0ed0d90efcf51574d0cad6b9a1cdc41280c242f983109658bb3718e1a3

See more details on using hashes here.

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