{"id":13297000,"url":"https://github.com/common-workflow-lab/cwl-d-auto","last_synced_at":"2026-02-02T05:54:53.341Z","repository":{"id":63444917,"uuid":"563731746","full_name":"common-workflow-lab/cwl-d-auto","owner":"common-workflow-lab","description":"Autogenerated classes for reading and writing CWL objects using the D language","archived":false,"fork":false,"pushed_at":"2024-08-28T16:02:49.000Z","size":324,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-28T17:45:48.438Z","etag":null,"topics":["commonwl","cwl","dlang","parser"],"latest_commit_sha":null,"homepage":"","language":"Common Workflow Language","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/common-workflow-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-09T08:05:47.000Z","updated_at":"2024-08-28T16:02:53.000Z","dependencies_parsed_at":"2024-03-31T14:48:25.064Z","dependency_job_id":null,"html_url":"https://github.com/common-workflow-lab/cwl-d-auto","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-workflow-lab%2Fcwl-d-auto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-workflow-lab%2Fcwl-d-auto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-workflow-lab%2Fcwl-d-auto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-workflow-lab%2Fcwl-d-auto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/common-workflow-lab","download_url":"https://codeload.github.com/common-workflow-lab/cwl-d-auto/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221164334,"owners_count":16767311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commonwl","cwl","dlang","parser"],"created_at":"2024-07-29T17:21:20.906Z","updated_at":"2026-02-02T05:54:53.284Z","avatar_url":"https://github.com/common-workflow-lab.png","language":"Common Workflow Language","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cwl-d-auto\n\n[![build](https://github.com/common-workflow-lab/cwl-d-auto/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/common-workflow-lab/cwl-d-auto/actions/workflows/ci.yml) [![license](https://badgen.net/github/license/common-workflow-lab/cwl-d-auto)](https://github.com/common-workflow-lab/cwl-d-auto/blob/main/LICENSE)  [![code.dlang.org](https://img.shields.io/dub/v/cwl-d.svg)](https://code.dlang.org/packages/cwl-d)\n\nAutogenerated classes for reading and writing CWL objects using the D language.\n\nIt integrates with [schema-salad-d](https://github.com/tom-tan/schema-salad-d) and provides the following features:\n\n- Support all the CWL v1.0, v1.1 and v1.2 documents\n- Load YAML files and nodes to generate corresponding D objects\n- Store D object for CWL to YAML nodes\n\n## How is the parser generated?\nEach parser is generated with [schema-salad-tool](https://github.com/common-workflow-language/schema_salad) as shown below.\n\n- CWL v1.0\n  ```console\n  $ schema-salad-tool --codegen dlang https://github.com/common-workflow-language/common-workflow-language/raw/codegen/v1.0/CommonWorkflowLanguage.yml --codegen-package cwl.v1_0 --codegen-parser-info \"CWL v1.0 parser generated with schema-salad-tool\" --codegen-examples resources/cwl-v1.0 \u003e v1_0.d\n  ```\n\n- CWL v1.1\n  ```console\n  $ schema-salad-tool --codegen dlang https://github.com/common-workflow-language/cwl-v1.1/raw/codegen/CommonWorkflowLanguage.yml --codegen-package cwl.v1_1 --codegen-parser-info \"CWL v1.1 parser generated with schema-salad-tool\" --codegen-examples resources/cwl-v1.1 \u003e v1_1.d\n  ```\n\n- CWL v1.2\n  ```console\n  $ schema-salad-tool --codegen dlang https://github.com/common-workflow-language/cwl-v1.2/raw/codegen/CommonWorkflowLanguage.yml --codegen-package cwl.v1_2 --codegen-parser-info \"CWL v1.2 parser generated with schema-salad-tool\" --codegen-examples resources/cwl-v1.2 \u003e v1_2.d\n  ```\n\n- You can specify the package name via `--codegen-package`.\n- You can add informative message into the generated package via `--codegen-parser-info`. It can be accessed via `cwl.v1_2.parserInfo`.\n\n## How to use\n\nSee [source/app.d](source/app.d) for a concrete example.\n\n```d\nimport cwl.v1_0; // auto generated CWL parser\nimport salad.resolver : absoluteURI;\n\nimport dyaml : Node;\nimport std : match, tryMatch, writefln;\n\n///// Loading file\n\nauto uri = file.absoluteURI;\n\n// dispatch with std.sumtype.match for loaded object\nauto doc = importFromURI(uri).match!(\n\t// typical case\n\t(DocumentRootType r) =\u003e r,\n\t// When loaded CWL has `$graph`, the result is DocumentRootType[]\n\t(DocumentRootType[] rs) =\u003e rs[0],\n);\n\n// use std.sumtype.tryMatch if you can assume the type of target object \n// The following `tryMatch` assumes `doc` is CLT or Workflow. Otherwise it throws an exception\nauto classStr = doc.tryMatch!(\n\t(CommandLineTool clt) =\u003e \"CommandLineTool\",\n\t(Workflow wf) =\u003e \"Workflow\",\n);\n\t\t\nwritefln!\"%s is %s class.\"(uri, classStr);\n\n///// Convert CWL object to YAML node\nauto yamlNode = doc.match!(d =\u003e Node(d));\n```\n\n### How to run the example\nThe example just prints the document class of a given CWL document.\n\n```console\n$ dub run -c demo -- resources/cwl-v1.0/valid_rename.cwl\n...\nRunning cwl-d-auto resources/cwl-v1.0/valid_rename.cwl\nfile:///workspaces/cwl-d-auto/resources/cwl-v1.0/valid_rename.cwl is CommandLineTool class.\n```\n\n## How to test\nIt checks that CWL documents in [`resources`](resources) can be loaded with parsers in [`source/cwl`](source/cwl_d_auto).\n```console\n$ dub test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommon-workflow-lab%2Fcwl-d-auto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommon-workflow-lab%2Fcwl-d-auto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommon-workflow-lab%2Fcwl-d-auto/lists"}