Metadata-Version: 2.4
Name: insula-earthcode-publication-tool
Version: 1.0.4
Summary: Insula EarthCODE Publication Tool
Author-email: Claudio Candelori <claudio.candelori@cgi.com>
Maintainer-email: Claudio Candelori <claudio.candelori@cgi.com>
Keywords: Italia,cgi,client,insula
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Requires-Python: >=3.9
Requires-Dist: pystac
Requires-Dist: pyyaml
Description-Content-Type: text/markdown

# Insula EarthCODE Publication Tool

Use this tool to generate templates with placeholder values for the EarthCODE project.
This tool can be used both as an import and as a CLI command.

## - Template Generator:
### CLI
<pre>
  -h, --help            show this help message and exit
  -p, --project         If present generate a project template with the same name
  -w, --workflow        If present generate a workflow template with the same name
  -t TARGET, --target TARGET
                        The target location where the templates will be generated.
</pre>
Example usage:
```shell
python template_generator.py -p -w -t targetdir
```

### Import
For usage inside notebooks just install the package [TBD], import it and call the `generate_template()` function.
`generate_template(project, workflow, target)`
Example usage equivalent to previous CLI call:
```python
generate_template(project=True, workflow=True, target="targetdir")
```

## - STAC Json Generator:

After filling the templates with the correct informations for a new product or workflow, the following command can
generate a STAC json conform to the Open Science Catalog.

The generated `project_collection.json` shall be moved to `catalog/projects/{project-id}/collection.json` in the OSC.   
The generated `workflow_record.json` shall be moved to `catalog/workflows/{workflow-id}/record.json` in the OSC

### CLI
<pre>
  -h, --help            show this help message and exit
  -p PROJECT, --project PROJECT
                        Project YAML template location
  -w WORKFLOW, --workflow WORKFLOW
                        Workflow YAML template location
  -t TARGET, --target TARGET
                        The target location where the STAC jsons will be created.
</pre>
Example usage:
```shell
python stac_generator.py -p templ/project.yaml -w templ/workflow.yaml -t targetdir
```

### Import
For usage inside notebooks just install the package [TBD], import it and call the `generate_stac()` function.
`generate_stac(project, workflow, target)`
Example usage equivalent to previous CLI call:
```python
generate_stac(project="templ/project.yaml", workflow="templ/workflow.yaml", target="targetdir")
```