Skip to main content

DSL for inferring the edges of a CWL workflow DAG

Project description

Sophios

doc-build-status

Sophios is a Python-first authoring layer for Common Workflow Language (CWL) workflows. It lets users describe command-line tool contracts, compose those tools into workflow DAGs, compile the graph to inspectable CWL, and run locally or prepare schema-validated compute submissions.

Documentation

The documentation is available on readthedocs.

Quick Start

See the installation guide for more details, but:

For pip users:

pip install sophios

Sophios installs its Python workflow-building and validation dependencies with the package. Some workflows also depend on external system tools such as Docker, Podman, Graphviz, Node.js, or the command-line programs invoked by your CWL tools.

For conda users / developers:

See the installation guide for developers

from pathlib import Path

from sophios.api.python.workflow import Step, Workflow


echo = Step(clt_path=Path("cwl_adapters") / "echo.cwl")
echo.inputs.message = "Hello World"

workflow = Workflow([echo], "hello_python")
compiled = workflow.compile()
compiled.write_cwl("autogenerated")
compiled.write_job_inputs("autogenerated")

For the file-native YAML path, the CLI still supports .wic workflows:

sophios --yaml docs/tutorials/helloworld.wic --graphviz --run_local --outdir helloworld_output --quiet

Sophios compiles both Python-authored workflows and .wic workflows to CWL. Users should inspect important generated DAGs and CWL artifacts before relying on edge inference in production workflows.

Python API

The public Python API is split into three deliberate surfaces:

  • sophios.api.python.tool_builder builds CWL CommandLineTool contracts.
  • sophios.api.python.workflow composes Step and Workflow DAGs.
  • sophios.compute_request packages compiled workflows for compute submission.

Use Workflow([steps], "name") to make the DAG explicit, Step(clt_path=...) for existing CWL tools, Step(tool) or tool.to_step() for in-memory tool-builder handoff, and workflow.compile() to produce the public compiled CWL boundary.

Edge Inference

Sophios can infer many linear edges based on CWL types, file formats, and naming conventions. In Python workflows, leaving a required step input unbound allows the compiler to apply the same inference mechanism used by .wic workflows. Inference is useful, but it is not a substitute for reviewing generated artifacts when correctness matters.

Subworkflows

Subworkflows are very useful for creating reusable, composable building blocks. As shown above, recursive subworkflows are fully supported, and the edge inference algorithm has been very carefully constructed to work across subworkflow boundaries.

Explicit CWL

Sophios produces ordinary CWL artifacts. Users do not need to write raw CWL for the common path, but generated CWL remains available for inspection, execution by CWL runners, and advanced integration.

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

sophios-0.6.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

sophios-0.6.0-py3-none-any.whl (190.8 kB view details)

Uploaded Python 3

File details

Details for the file sophios-0.6.0.tar.gz.

File metadata

  • Download URL: sophios-0.6.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for sophios-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f3872b52839cc9a855046c07f6ea70bb11196a3a2c60f2ac3dfdf2abd75cfc23
MD5 903e11f854ca8dd0877aff2a23dbd8ea
BLAKE2b-256 c37ca928e4d64dd620e89e4d5c55bb32cc26ddc6a055aaafdd16380ade9a6e5c

See more details on using hashes here.

File details

Details for the file sophios-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: sophios-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 190.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for sophios-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebc8a3c905a8f7cc2fdfe52d49c1fb74fa8bc41bf19a846d7990c1ea54a7cf8f
MD5 eadef3100745eecfdb01927a74a5022f
BLAKE2b-256 7699ac97e3ca01208ca8f4d479ddd56503032a0586ceeeaa8fb5d1668a9f91d1

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