Metadata-Version: 2.4
Name: transpiler-mate
Version: 0.33.0
Summary: Schema.org 2 metadata formats transpiler
Project-URL: Documentation, https://github.com/Terradue/transpiler-mate#readme
Project-URL: Issues, https://github.com/Terradue/transpiler-mate/issues
Project-URL: Source, https://github.com/Terradue/transpiler-mate
Author-email: Fabrice Brito <info@terradue.com>, Simone Tripodi <info@terradue.com>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: click==8.3.1
Requires-Dist: cwl-loader==0.15.0
Requires-Dist: email-validator==2.3.0
Requires-Dist: giturlparse==0.14.0
Requires-Dist: invenio-rest-api-client==12.0.2
Requires-Dist: jinja2==3.1.6
Requires-Dist: loguru==0.7.3
Requires-Dist: pydantic==2.12.5
Requires-Dist: ruamel-yaml<0.19
Requires-Dist: semver==3.0.4
Requires-Dist: yaml-ld==1.1.17
Description-Content-Type: text/markdown

# Transpiler Mate

Transpiler Mate is a Python library and CLI that extracts `schema.org/SoftwareApplication` metadata from annotated CWL documents and converts it into publication-ready formats.

## What It Does

Given an input CWL metadata source, Transpiler Mate can:

- Generate **CodeMeta** JSON-LD.
- Generate **DataCite** metadata payloads.
- Generate **OGC API - Records** payloads.
- Generate **Markdown** documentation for workflows.
- Generate **OCI Annotations**.
- Publish records to **InvenioRDM**.
- Bump semantic versions in metadata files.

Documentation: <https://terradue.github.io/transpiler-mate/>

## Supported Outputs

- CodeMeta: <https://codemeta.github.io/>
- DataCite Metadata: <https://inveniordm.docs.cern.ch/reference/metadata/#metadata>
- OGC API - Records: <https://ogcapi.ogc.org/records/>
- OCI Annotations: <https://oras.land/docs/how_to_guides/manifest_annotations/>
- InvenioRDM: <https://inveniosoftware.org/products/rdm/>

## Requirements

- Python `>= 3.10`

## Installation

### From source (recommended for development)

```bash
git clone https://github.com/Terradue/transpiler-mate.git
cd transpiler-mate
pip install -e .
```

### Install tooling for local workflows

```bash
pip install hatch ruff
```

## CLI Usage

Entry point:

```bash
transpiler-mate --help
```

Main commands:

- `transpiler-mate codemeta <source> [--code-repository URL] [--output codemeta.json]`
- `transpiler-mate datacite <source> [--output datacite.json]`
- `transpiler-mate ogcrecord <source> [--output record.json]`
- `transpiler-mate markdown <source> --workflow-id <id> [--output DIR] [--code-repository URL]`
- `transpiler-mate oci-annotations <source> --workflow-id <id> [--image-source URL] [--image-revision ] [--output annotations.json]`
- `transpiler-mate invenio-publish <source> --base-url URL --auth-token TOKEN [--attach FILE ...]`
- `transpiler-mate bump-version <source> [--version-part major|minor|patch|build|pre-release]`

### Examples

Generate CodeMeta:

```bash
transpiler-mate codemeta ./metadata.cwl --output ./dist/codemeta.json
```

Generate DataCite metadata:

```bash
transpiler-mate datacite ./metadata.cwl --output ./dist/datacite.json
```

Generate OGC Record:

```bash
transpiler-mate ogcrecord ./metadata.cwl --output ./dist/record.json
```

Generate Markdown documentation:

```bash
transpiler-mate markdown ./workflow.cwl --workflow-id main --output ./docs
```

Publish to InvenioRDM:

```bash
export INVENIO_AUTH_TOKEN="<token>"
transpiler-mate invenio-publish ./metadata.cwl --base-url https://invenio.example.org --auth-token "$INVENIO_AUTH_TOKEN"
```

## Development

Run lint and formatting checks:

```bash
hatch run dev:check
hatch run dev:lint
```

Run tests for one interpreter:

```bash
hatch run test.py3.12:test-q
```

Run full Hatch test matrix (local environment permitting):

```bash
hatch run test:test-q
```

## Project Tasks

`Taskfile.yaml` includes helper tasks for schema/model generation and quality checks:

- `task test`
- `task check`
- `task lint`

## License

Apache License 2.0. See [LICENSE](LICENSE).
