Skip to content
transpiler-matePublic

About

Convert CWL inputs and outputs into OGC API – Processes descriptors and JSON Schemas with Transpiler-Mate.

Topics

Resources

Contributing

Stars

8 stars

Watchers

1 watching

Forks

Repository files navigation

cwl2ogc

PyPI - Version PyPI - Python Version GitHub Actions Workflow Status Code coverage

cwl2ogc converts CWL workflow/tool inputs and outputs into:

  • OGC API - Processes I/O descriptors
  • JSON Schema documents for those I/O definitions

This is useful when publishing CWL-based application packages through OGC API - Processes interfaces.

Warning

Since release 0.20.0, cwl2ogc is also available as a transpiler-mate plugin. Use transpiler-mate cwl2ogc for command-line conversion; the standalone cwl2ogc command was removed in 0.18.0. The Python library remains available. See the plugin guide for installation and usage.

Why

The OGC API - Processes Deploy/Replace/Undeploy workflow requires a process description that exposes valid input and output metadata. cwl2ogc helps generate that description directly from CWL definitions.

Installation

pip install cwl2ogc

Python 3.10+ is required.

Quick Start (transpiler-mate plugin)

Install the runtime and plugin in the same Python environment:

pip install transpiler-mate-runtime "cwl2ogc>=0.20.0"

Generate OGC input/output descriptions from your CWL document:

transpiler-mate cwl2ogc --output processes.json workflow.cwl

Show command help:

transpiler-mate cwl2ogc --help

The output maps workflow IDs to process descriptions, each containing application metadata. Selecting a process with a source fragment produces one description. See the plugin guide for source requirements and output details.

Quick Start (Python API)

from cwl_utils.parser import load_document_by_uri
from cwl2ogc import BaseCWLtypes2OGCConverter

workflow = load_document_by_uri("tests/artifacts/cwl-types/inp.cwl#inp")
converter = BaseCWLtypes2OGCConverter(workflow)

inputs = converter.get_inputs()
outputs = converter.get_outputs()

inputs_json_schema = converter.get_inputs_json_schema()
outputs_json_schema = converter.get_outputs_json_schema()

Playground

Requirements:

  • docker
  • task

Run the published playground image:

task run-playground

Build and run the local playground image:

task run-playground-dev

Open http://127.0.0.1.

Development

Install development tooling with Hatch and run checks:

hatch run test:test
hatch run dev:check
hatch run dev:lint

Documentation

Project documentation is organized around four needs:

Contributing

Issues and pull requests are welcome: https://github.com/transpiler-mate/cwl2ogc/issues

Local quality checks

Install Hatch and Taskfiles then install the Git hook:

task quality:pre-commit:install

Every commit runs Ruff (including the configured McCabe complexity limit), Ruff formatting, strict mypy checks, and the pytest suite. Run the complete hook explicitly with:

task quality:pre-commit:run

License

Apache License, Version 2.0

About

Convert CWL inputs and outputs into OGC API – Processes descriptors and JSON Schemas with Transpiler-Mate.

Topics

Resources

Contributing

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages