Skip to main content

Fork of python-cwlgen | Generation of CWL programmatically. Avaible types: CommandLineTool, Workflow and Requirements

Project description

python-cwlgen

(From original repository)

Build Status codecov Documentation Status PyPI version

Python-cwlgen is a python library for the generation of CWL programmatically. It supports the generation of CommandLineTool, Workflow and DockerRequirement. The library works for both Python 2.7.12+ and 3.6.0.


I've forked this repository to try and get my use of this repository working quickly without worrying too much about proper code etiquette. I have and will continue to submit merge requests back to the original repository.

Build Status codecov PyPI version

Common Workflow Language

Common Workflow Language (CWL) is a method to describe workflows, and any tools (software) that it may use. The user guide gives a gentle (and better) explanation of what its goals are, and how they are achieved, but broadly:

  1. Stop writing bash scripts for long complex jobs.
  2. Take pipelines anywhere (portability).
  3. Try to enforce reproducibility guidelines.

This python repository is simply a python wrapper for most of the classes (work in progress), allowing you to build the structure of the workflow in Python and have this module generate and export CWL for you.

Nb: This isn't going to sanity or quality check Workflows or CommandLineTools for you, use CWLTool or WOMTool for that.

Quick-start guide

This is available through PIP!

pip install illusional.cwlgen

How it works ?

There's a pretty close copy of the cwl specifications (Workflow| CommandLineTool), where the Python classes mirror the CWL spec. This repository also includes some of the docstrings to give you context of classes and their properties.

I've tried to include direct links to a classes documentation, however this isn't always possible.

There are some small examples in the examples/ folder, however for whatever class you need, you simply just init that class, for example:

Creating a CommandLineTool

# if using gitsubmodules, you can use the following import statement
import cwlgen as cwl

tool_object = cwl.CommandLineTool(cwltool_id="echo-tool", base_command="echo", label=None, doc=None,
                 cwl_version="v1.0", stdin=None, stderr=None, stdout=None, path=None)
tool_object.inputs.append(cwl.CommandInputParameter("myParamId", label=None, secondary_files=None, param_format=None,
                 streamable=None, doc=None, input_binding=None, default=None, param_type=None))
                 
# fill in the fields as required

# to get the dictionary representation:
dict_to_export = tool_object.get_dict()

# dump using a yaml exporter
yaml.dump(dict_to_export)

All of the classes should work in a similar way. I've removed the literal representation from my fork as I didn't want to use ruamel at the moment. Otherwise file an issue and I'll have a look into it.

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

illusional.cwlgen-0.0.5.tar.gz (25.6 kB view details)

Uploaded Source

File details

Details for the file illusional.cwlgen-0.0.5.tar.gz.

File metadata

  • Download URL: illusional.cwlgen-0.0.5.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/2.7.14

File hashes

Hashes for illusional.cwlgen-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1f7fcb5c500a12b4bbd8f75aa4815da42fa6d38fedf1d2f8e05c018cc8947ab1
MD5 8dd102caa2fb53b4bbd25fc336a451fa
BLAKE2b-256 c8a3ec61d96308b7453f4c76d25a645949842564ca3428c9b6b1207d37599b66

See more details on using hashes here.

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