Skip to main content

No project description provided

Project description

Linux Build Status Code coverage Documentation Status

cwl-utils

A collection of scripts to demonstrate the use of the new Python classes for loading and parsing CWL v1.0, CWL v1.1, and CWL v1.2 documents.

Requires Python 3.6+

Installation

pip3 install cwl-utils

To install from source:

git clone https://github.com/common-workflow-language/cwl-utils.git
cd cwl-utils
pip3 install .

Usage

Pull the all referenced software container images

docker_extract.py is useful to cache or pre-pull all software container images referenced in a CWL CommandLineTool or CWL Workflow (including all referenced CommandLineTools and sub-Workflows and so on).

The default behaviour is to use the Docker engine to download and save the software container images in Docker format.

docker_extract.py DIRECTORY path_to_my_workflow.cwl

Or you can use the Singularity software container engine to download and save the software container images and convert them to the Singularity format at the same time.

docker_extract.py --singularity DIRECTORY path_to_my_workflow.cwl

Using the CWL Parsers

from pathlib import Path
from ruamel import yaml
import sys

from cwl_utils.parser import load_document_by_uri, save

# File Input - This is the only thing you will need to adjust or take in as an input to your function:
cwl_file = Path("testdata/md5sum.cwl")  # or a plain string works as well

# Import CWL Object
cwl_obj = load_document_by_uri(cwl_file)

# View CWL Object
print("List of object attributes:\n{}".format("\n".join(map(str, dir(cwl_obj)))))

# Export CWL Object into a built-in typed object
saved_obj = save(cwl_obj)
print(f"Export of the loaded CWL object: {saved_obj}.")

Development

Regenerate parsers

To regenerate install the schema_salad package and run:

cwl_utils/parser/cwl_v1_0.py was created via schema-salad-tool --codegen python https://github.com/common-workflow-language/common-workflow-language/raw/main/v1.0/CommonWorkflowLanguage.yml --codegen-parser-info "org.w3id.cwl.v1_0"

cwl_utils/parser/cwl_v1_1.py was created via schema-salad-tool --codegen python https://github.com/common-workflow-language/cwl-v1.1/raw/main/CommonWorkflowLanguage.yml --codegen-parser-info "org.w3id.cwl.v1_1"

cwl_utils/parser/cwl_v1_2.py was created via schema-salad-tool --codegen python https://github.com/common-workflow-language/cwl-v1.2/raw/1.2.1_proposed/CommonWorkflowLanguage.yml --codegen-parser-info "org.w3id.cwl.v1_2"

Release

To release CWLUtils, bump the version in cwl_utils/__meta__.py, and tag that commit with the new version. The gh-action-pypi-publish should release that tag.

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

cwl-utils-0.16.tar.gz (430.7 kB view details)

Uploaded Source

Built Distribution

cwl_utils-0.16-py3-none-any.whl (469.3 kB view details)

Uploaded Python 3

File details

Details for the file cwl-utils-0.16.tar.gz.

File metadata

  • Download URL: cwl-utils-0.16.tar.gz
  • Upload date:
  • Size: 430.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cwl-utils-0.16.tar.gz
Algorithm Hash digest
SHA256 38182e6dd12b039601ac2f72911b3d93ca4e37efca3b0165ffe162abab3edf7b
MD5 dc49e4c2bad9e7766659bcfd99d17475
BLAKE2b-256 b6e3f53eb41bc3350a4cb55911d054e14af24b43117196e4cfcea7b5daae5f48

See more details on using hashes here.

Provenance

File details

Details for the file cwl_utils-0.16-py3-none-any.whl.

File metadata

  • Download URL: cwl_utils-0.16-py3-none-any.whl
  • Upload date:
  • Size: 469.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cwl_utils-0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 3583d02a9f066e0b2710bc974730c37cf8bb4c42c14c5be961357644a3c8f159
MD5 9776751168767608d0223718fc2c2ff6
BLAKE2b-256 a9dd7cddf8fc972c5e62573bf76dec877eb6b20ff89c52a2aacee38e3fd5bdcd

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page