osc-metadata-client 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. osc_metadata_client-0.3.0/.env +1 -0
  2. osc_metadata_client-0.3.0/.github/dependabot.yml +32 -0
  3. osc_metadata_client-0.3.0/.github/workflows/docs.yaml +41 -0
  4. osc_metadata_client-0.3.0/.github/workflows/package.yaml +97 -0
  5. osc_metadata_client-0.3.0/.gitignore +9 -0
  6. osc_metadata_client-0.3.0/LICENSE +201 -0
  7. osc_metadata_client-0.3.0/PKG-INFO +44 -0
  8. osc_metadata_client-0.3.0/README.md +15 -0
  9. osc_metadata_client-0.3.0/Taskfile.yaml +210 -0
  10. osc_metadata_client-0.3.0/cwl-workflows/.env +4 -0
  11. osc_metadata_client-0.3.0/cwl-workflows/git_repository.cwl +226 -0
  12. osc_metadata_client-0.3.0/cwl-workflows/publish_experiment_products.cwl +312 -0
  13. osc_metadata_client-0.3.0/cwl-workflows/publish_workflow.cwl +209 -0
  14. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products/activity.svg +1 -0
  15. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products/class.svg +1 -0
  16. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products/component.svg +1 -0
  17. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products/ogc_processes_inputs.svg +1 -0
  18. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products/ogc_processes_outputs.svg +1 -0
  19. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products/sequence.svg +1 -0
  20. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products/state.svg +1 -0
  21. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_experiment_products.md +269 -0
  22. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow/activity.svg +1 -0
  23. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow/class.svg +1 -0
  24. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow/component.svg +1 -0
  25. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow/ogc_processes_inputs.svg +1 -0
  26. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow/ogc_processes_outputs.svg +1 -0
  27. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow/sequence.svg +1 -0
  28. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow/state.svg +1 -0
  29. osc_metadata_client-0.3.0/docs/c4/components/workflow/publish_workflow.md +223 -0
  30. osc_metadata_client-0.3.0/docs/cli.md +156 -0
  31. osc_metadata_client-0.3.0/docs/diagrams/src/flow/experiments.puml +53 -0
  32. osc_metadata_client-0.3.0/docs/diagrams/src/flow/products.puml +55 -0
  33. osc_metadata_client-0.3.0/docs/diagrams/src/flow/workflow.puml +29 -0
  34. osc_metadata_client-0.3.0/docs/diagrams/src/sequence/experiments.puml +44 -0
  35. osc_metadata_client-0.3.0/docs/diagrams/src/sequence/products.puml +44 -0
  36. osc_metadata_client-0.3.0/docs/diagrams/src/sequence/workflow.puml +28 -0
  37. osc_metadata_client-0.3.0/docs/imgs/icon-eoap.png +0 -0
  38. osc_metadata_client-0.3.0/docs/index.md +42 -0
  39. osc_metadata_client-0.3.0/mkdocs.yaml +88 -0
  40. osc_metadata_client-0.3.0/pyproject.toml +105 -0
  41. osc_metadata_client-0.3.0/schemas/osc_ogcapi_records_models.yaml +79 -0
  42. osc_metadata_client-0.3.0/src/osc_metadata_client/__about__.py +15 -0
  43. osc_metadata_client-0.3.0/src/osc_metadata_client/__init__.py +275 -0
  44. osc_metadata_client-0.3.0/src/osc_metadata_client/cli.py +161 -0
  45. osc_metadata_client-0.3.0/src/osc_metadata_client/experiment.py +136 -0
  46. osc_metadata_client-0.3.0/src/osc_metadata_client/models.py +78 -0
  47. osc_metadata_client-0.3.0/src/osc_metadata_client/osc_extension.py +222 -0
  48. osc_metadata_client-0.3.0/src/osc_metadata_client/product.py +151 -0
  49. osc_metadata_client-0.3.0/src/osc_metadata_client/themes_extension.py +236 -0
  50. osc_metadata_client-0.3.0/src/osc_metadata_client/workflow.py +92 -0
  51. osc_metadata_client-0.3.0/tests/__init__.py +13 -0
  52. osc_metadata_client-0.3.0/tests/conftest.py +181 -0
  53. osc_metadata_client-0.3.0/tests/test_about_models_osc_extension.py +139 -0
  54. osc_metadata_client-0.3.0/tests/test_cli.py +180 -0
  55. osc_metadata_client-0.3.0/tests/test_init_workflow_experiment_product.py +390 -0
  56. osc_metadata_client-0.3.0/tests/test_themes_extension.py +182 -0
@@ -0,0 +1 @@
1
+ TASK_X_REMOTE_TASKFILES=1
@@ -0,0 +1,32 @@
1
+ # Copyright 2026 Terradue
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ version: 2
16
+ updates:
17
+ - package-ecosystem: "pip"
18
+ directory: "/"
19
+ schedule:
20
+ interval: "daily"
21
+ time: "05:00"
22
+ timezone: "Europe/Rome"
23
+ versioning-strategy: "increase"
24
+ open-pull-requests-limit: 10
25
+
26
+ - package-ecosystem: "github-actions"
27
+ directory: "/"
28
+ schedule:
29
+ interval: "daily"
30
+ time: "05:15"
31
+ timezone: "Europe/Rome"
32
+ open-pull-requests-limit: 5
@@ -0,0 +1,41 @@
1
+ # Copyright 2026 Terradue
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ name: docs
16
+ on:
17
+ push:
18
+ branches:
19
+ - docs
20
+ - develop
21
+ - main
22
+ paths:
23
+ # Only rebuild website when docs have changed
24
+ - 'README.md'
25
+ - 'docs/**'
26
+ - 'mkdocs.yml'
27
+ - .github/**
28
+
29
+ jobs:
30
+ deploy:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - name: Checkout master
34
+ uses: actions/checkout@v6
35
+
36
+ - name: Set up Python 3.x
37
+ uses: actions/setup-python@v6
38
+ with:
39
+ python-version: 3.x
40
+ - run: pip install mkdocs-material mkdocs-mermaid2-plugin mkdocs-build-plantuml-plugin
41
+ - run: mkdocs gh-deploy --force
@@ -0,0 +1,97 @@
1
+ # Copyright 2026 Terradue
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ name: package
16
+
17
+ on:
18
+ push:
19
+ branches:
20
+ - feature
21
+ - feature/**
22
+ - develop
23
+ - main
24
+ tags:
25
+ - v*.*.*
26
+ pull_request:
27
+ branches:
28
+ - feature
29
+ - feature/**
30
+ - develop
31
+ - main
32
+
33
+ permissions:
34
+ contents: read
35
+
36
+ jobs:
37
+ ci:
38
+ if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/')
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v6
42
+
43
+ - name: Set up Python
44
+ uses: actions/setup-python@v6
45
+ with:
46
+ python-version: '3.12'
47
+ cache: pip
48
+
49
+ - name: Install tooling
50
+ run: pip install hatch ruff
51
+
52
+ - name: Ruff Check
53
+ run: ruff check .
54
+
55
+ - name: Ruff Lint
56
+ run: ruff format --check .
57
+
58
+ - name: Run tests
59
+ run: hatch run test:test-q
60
+
61
+ publish:
62
+ if: startsWith(github.ref, 'refs/tags/v')
63
+ runs-on: ubuntu-latest
64
+ environment: release
65
+ permissions:
66
+ id-token: write
67
+ contents: read
68
+ steps:
69
+ - uses: actions/checkout@v6
70
+
71
+ - name: Set up Python
72
+ uses: actions/setup-python@v6
73
+ with:
74
+ python-version: '3.12'
75
+ cache: pip
76
+
77
+ - name: Install Hatch
78
+ run: pip install hatch
79
+
80
+ - name: Verify tag matches project version
81
+ run: |
82
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
83
+ PROJECT_VERSION="$(hatch version)"
84
+
85
+ echo "Tag version: ${TAG_VERSION}"
86
+ echo "Project version: ${PROJECT_VERSION}"
87
+
88
+ if [ "${TAG_VERSION}" != "${PROJECT_VERSION}" ]; then
89
+ echo "Tag ${GITHUB_REF_NAME} does not match project version ${PROJECT_VERSION}"
90
+ exit 1
91
+ fi
92
+
93
+ - name: Build package
94
+ run: hatch build
95
+
96
+ - name: Publish package distributions to PyPI
97
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ *_bundled.cwl
2
+ .task
3
+ .venv
4
+ .vscode
5
+ .ruff_cache
6
+ .pytest_cache
7
+ __pycache__
8
+ docs/diagrams/out/
9
+ osc_sequences.sh
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.4
2
+ Name: osc-metadata-client
3
+ Version: 0.3.0
4
+ Summary: Open Science Catalog client
5
+ Project-URL: Documentation, https://github.com/Terradue/osc-metadata-client#readme
6
+ Project-URL: Issues, https://github.com/Terradue/osc-metadata-client/issues
7
+ Project-URL: Source, https://github.com/Terradue/osc-metadata-client
8
+ Author-email: Simone Tripodi <simone.tripodi@terradue.com>, Fabrice Brito <fabrice.brito@terradue.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: Implementation :: CPython
19
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
20
+ Requires-Python: >=3.8
21
+ Requires-Dist: click==8.3.3
22
+ Requires-Dist: loguru==0.7.3
23
+ Requires-Dist: ogc-api-processes-client==0.5.0
24
+ Requires-Dist: pydantic==2.12.5
25
+ Requires-Dist: pystac==1.14.3
26
+ Requires-Dist: session-adapters==0.3.0
27
+ Requires-Dist: transpiler-mate==0.44.0
28
+ Description-Content-Type: text/markdown
29
+
30
+ # Open Science Catalog Client
31
+
32
+ `osc-client` is a CLI tool that simplifies metadata production for the
33
+ [Open Science Catalog](https://github.com/ESA-EarthCODE/open-science-catalog-metadata)
34
+ starting from [CWL](https://www.commonwl.org/) workflows executed on
35
+ [OGC API - Processes](https://docs.ogc.org/is/18-062r2/18-062r2.html) instances.
36
+
37
+ It helps transform workflow descriptions and execution metadata into catalog-ready
38
+ records for Open Science Catalog resources such as workflows, experiments, and
39
+ products.
40
+
41
+ ## License
42
+
43
+ This software is released under the
44
+ [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) license.
@@ -0,0 +1,15 @@
1
+ # Open Science Catalog Client
2
+
3
+ `osc-client` is a CLI tool that simplifies metadata production for the
4
+ [Open Science Catalog](https://github.com/ESA-EarthCODE/open-science-catalog-metadata)
5
+ starting from [CWL](https://www.commonwl.org/) workflows executed on
6
+ [OGC API - Processes](https://docs.ogc.org/is/18-062r2/18-062r2.html) instances.
7
+
8
+ It helps transform workflow descriptions and execution metadata into catalog-ready
9
+ records for Open Science Catalog resources such as workflows, experiments, and
10
+ products.
11
+
12
+ ## License
13
+
14
+ This software is released under the
15
+ [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) license.
@@ -0,0 +1,210 @@
1
+ # Copyright 2026 Terradue
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ version: '3'
16
+
17
+ includes:
18
+ json: https://raw.githubusercontent.com/Terradue/taskfile-utils/refs/heads/main/json.yaml
19
+ quality: https://raw.githubusercontent.com/Terradue/taskfile-utils/refs/heads/main/quality.yaml
20
+
21
+ tasks:
22
+
23
+ datamodel_codegen:
24
+ cmds:
25
+ - task: json:create_models
26
+ vars:
27
+ SCHEMA: './schemas/osc_ogcapi_records_models.yaml'
28
+ BASE_CLASS: 'transpiler_mate.ogcapi.records.ogcapi_records_models.RecordCommonProperties'
29
+ OUTPUT: './src/osc_metadata_client/models.py'
30
+
31
+ bundle_worflow:
32
+ internal: true
33
+ cmds:
34
+ - |
35
+ uv run \
36
+ --no-cache \
37
+ --no-project \
38
+ --with cwl-loader \
39
+ cwl-loader bundle \
40
+ ./cwl-workflows/{{.WORKFLOW_ID}}.cwl \
41
+ --output ./cwl-workflows/{{.WORKFLOW_ID}}_bundled.cwl
42
+
43
+ generate_workflow_doc:
44
+ internal: true
45
+ vars:
46
+ DOC_DIR: './docs/c4/components/workflow'
47
+ REPO_URL:
48
+ sh: git config --get remote.origin.url
49
+ cmds:
50
+ - task: bundle_worflow
51
+ vars:
52
+ WORKFLOW_ID: "{{.WORKFLOW_ID}}"
53
+ - mkdir -p {{.DOC_DIR}}
54
+ - |
55
+ uv run \
56
+ --no-cache \
57
+ --no-project \
58
+ --with cwltool \
59
+ cwltool --validate ./cwl-workflows/{{.WORKFLOW_ID}}_bundled.cwl
60
+ - |
61
+ uv run --no-cache --no-project --with transpiler-mate transpiler-mate markdown \
62
+ --workflow-id {{.WORKFLOW_ID}} \
63
+ --output {{.DOC_DIR}} \
64
+ --code-repository {{.REPO_URL}} \
65
+ ./cwl-workflows/{{.WORKFLOW_ID}}_bundled.cwl
66
+ - |
67
+ uv run --no-cache --no-project --with cwl2puml cwl2puml --workflow-id {{.WORKFLOW_ID}} \
68
+ --output {{.DOC_DIR}}/{{.WORKFLOW_ID}} \
69
+ --convert-image \
70
+ --image-format svg \
71
+ ./cwl-workflows/{{.WORKFLOW_ID}}_bundled.cwl
72
+ - rm -rf {{.DOC_DIR}}/{{.WORKFLOW_ID}}/*.puml
73
+
74
+ generate_workflows_doc:
75
+ desc: Generate markdown and workflow diagrams for FEM, FFM and FHM CWL workflow
76
+ vars:
77
+ WORKFLOWS:
78
+ - 'publish_workflow'
79
+ - 'publish_experiment_products'
80
+ cmds:
81
+ - for:
82
+ var: WORKFLOWS
83
+ as: WORKFLOW_ID
84
+ task: generate_workflow_doc
85
+ vars:
86
+ WORKFLOW_ID: '{{.WORKFLOW_ID}}'
87
+
88
+ publish_workflow:
89
+ desc: Invoke the bundled publish_workflow CWL workflow
90
+ requires:
91
+ vars:
92
+ - WORKFLOW_ID
93
+ - PROJECT_ID
94
+ - PROJECT_NAME
95
+ - OGC_API_PROCESSES_ENDPOINT
96
+ - CWL_WORKFLOW_LOCATION
97
+ cmds:
98
+ - task: bundle_worflow
99
+ vars:
100
+ WORKFLOW_ID: "publish_workflow"
101
+ - |
102
+ set -eu
103
+
104
+ set -a
105
+ . ./cwl-workflows/.env
106
+ set +a
107
+
108
+ job_order="$(mktemp --suffix=.json publish_workflow.XXXXXXX)"
109
+ trap 'rm -f "$job_order"' EXIT
110
+
111
+ jq -n \
112
+ --arg workflow_id {{shellQuote .WORKFLOW_ID}} \
113
+ --arg project_id {{shellQuote .PROJECT_ID}} \
114
+ --arg project_name {{shellQuote .PROJECT_NAME}} \
115
+ --arg ogc_api_processes_endpoint {{shellQuote .OGC_API_PROCESSES_ENDPOINT}} \
116
+ --arg cwl_workflow_location {{shellQuote .CWL_WORKFLOW_LOCATION}} \
117
+ '{
118
+ workflow_id: $workflow_id,
119
+ project_id: $project_id,
120
+ project_name: $project_name,
121
+ ogc_api_processes_endpoint: {
122
+ value: $ogc_api_processes_endpoint
123
+ },
124
+ cwl_workflow_location: {
125
+ value: $cwl_workflow_location
126
+ }
127
+ }' > "$job_order"
128
+
129
+ uv run \
130
+ --no-cache \
131
+ --no-project \
132
+ --with cwltool \
133
+ cwltool \
134
+ --preserve-environment REPOSITORY_PATH \
135
+ --preserve-environment REPOSITORY_URL \
136
+ --preserve-environment BRANCH \
137
+ --preserve-environment REMOTE \
138
+ ./cwl-workflows/publish_workflow_bundled.cwl#publish_workflow \
139
+ "$job_order"
140
+
141
+ publish_experiment_products:
142
+ desc: Invoke the bundled publish_experiment_products CWL workflow
143
+ requires:
144
+ vars:
145
+ - JOB_ID
146
+ - PROJECT_ID
147
+ - PROJECT_NAME
148
+ - OGC_API_PROCESSES_ENDPOINT
149
+ - CWL_WORKFLOW_LOCATION
150
+ - WORKFLOW_ID
151
+ - AUTHORIZATION_TOKEN
152
+ cmds:
153
+ - task: bundle_worflow
154
+ vars:
155
+ WORKFLOW_ID: "publish_experiment_products"
156
+ - |
157
+ set -eu
158
+
159
+ set -a
160
+ . ./cwl-workflows/.env
161
+ set +a
162
+
163
+ job_order="$(mktemp --suffix=.json publish_experiment_products.XXXXXXX)"
164
+ trap 'rm -f "$job_order"' EXIT
165
+
166
+ jq -n \
167
+ --arg job_id {{shellQuote .JOB_ID}} \
168
+ --arg project_id {{shellQuote .PROJECT_ID}} \
169
+ --arg project_name {{shellQuote .PROJECT_NAME}} \
170
+ --arg ogc_api_processes_endpoint {{shellQuote .OGC_API_PROCESSES_ENDPOINT}} \
171
+ --arg cwl_workflow_location {{shellQuote .CWL_WORKFLOW_LOCATION}} \
172
+ --arg workflow_id {{shellQuote .WORKFLOW_ID}} \
173
+ --arg authorization_token {{shellQuote .AUTHORIZATION_TOKEN}} \
174
+ '{
175
+ job_id: $job_id,
176
+ project_id: $project_id,
177
+ project_name: $project_name,
178
+ ogc_api_processes_endpoint: {
179
+ value: $ogc_api_processes_endpoint
180
+ },
181
+ cwl_workflow_location: {
182
+ value: $cwl_workflow_location
183
+ },
184
+ workflow_id: $workflow_id,
185
+ authorization_token: $authorization_token
186
+ }' > "$job_order"
187
+
188
+ uv run \
189
+ --no-cache \
190
+ --no-project \
191
+ --with cwltool \
192
+ cwltool \
193
+ --preserve-environment REPOSITORY_PATH \
194
+ --preserve-environment REPOSITORY_URL \
195
+ --preserve-environment BRANCH \
196
+ --preserve-environment REMOTE \
197
+ ./cwl-workflows/publish_experiment_products_bundled.cwl#publish_experiment_products \
198
+ "$job_order"
199
+
200
+ serve_docs:
201
+ desc: Serve the MkDocs site locally
202
+ cmds:
203
+ - |
204
+ uv run \
205
+ --no-project \
206
+ --with mkdocs \
207
+ --with mkdocs-material \
208
+ --with mkdocs-mermaid2-plugin \
209
+ --with mkdocs-build-plantuml-plugin \
210
+ mkdocs serve
@@ -0,0 +1,4 @@
1
+ REPOSITORY_PATH=$(mktemp -d "${TMPDIR:-/tmp}/OSC-XXXXXX")
2
+ REPOSITORY_URL=https://github.com/Terradue/open-science-catalog-metadata-staging.git
3
+ BRANCH=main
4
+ REMOTE=origin