parseo 0.4.4__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.
- parseo-0.4.4/LICENSE.txt +287 -0
- parseo-0.4.4/MANIFEST.in +1 -0
- parseo-0.4.4/PKG-INFO +402 -0
- parseo-0.4.4/README.md +365 -0
- parseo-0.4.4/pyproject.toml +77 -0
- parseo-0.4.4/setup.cfg +4 -0
- parseo-0.4.4/src/parseo/__init__.py +53 -0
- parseo-0.4.4/src/parseo/_epsg_lookup.py +145 -0
- parseo-0.4.4/src/parseo/_field_mappings.py +219 -0
- parseo-0.4.4/src/parseo/_json.py +14 -0
- parseo-0.4.4/src/parseo/_tile_systems.py +51 -0
- parseo-0.4.4/src/parseo/assembler.py +225 -0
- parseo-0.4.4/src/parseo/cli.py +383 -0
- parseo-0.4.4/src/parseo/parser.py +784 -0
- parseo-0.4.4/src/parseo/schema_registry.py +246 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/clc/clc_filename_v1_0_0.json +48 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/clc/clc_filename_v1_1_0.json +65 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/clcplus/ras/clcplus_filename_v0_0_0.json +90 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/clcplus/ras/clcplus_filename_v0_0_1.json +80 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/egms/egms_gnss_model_filename_v0_0_0.json +46 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/egms/egms_l2a_product_filename_v0_0_0.json +71 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/egms/egms_l3_velocity_grid_filename_v0_0_0.json +64 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/euhydro/euhydro_filename_v0_0_0.json +115 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/euhydro/euhydro_filename_v0_0_1.json +103 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-vpp/st_filename_v0_0_0.json +82 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-vpp/vi_filename_v0_0_0.json +89 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-vpp/vpp_filename_v0_0_0.json +109 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/cc_filename_v0_0_0.json +84 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/fsc_filename_v0_0_0.json +88 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/gfsc_filename_v0_0_0.json +83 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/icd_filename_v0_0_0.json +96 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/sp_filename_v0_0_0.json +177 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/sws_filename_v0_0_0.json +83 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/wcd_filename_v0_0_0.json +96 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/wds_filename_v0_0_0.json +83 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/wic_comb_filename_v0_0_0.json +82 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hr-wsi/wic_filename_v0_0_0.json +90 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/fty_filename_v0_0_0.json +48 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/gra_filename_v0_0_0.json +48 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/ibu_filename_v0_0_0.json +57 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/imp_filename_v0_0_0.json +48 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/nvlcc_filename_v0_0_0.json +73 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/nvlcc_filename_v0_0_1.json +89 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/nvlcc_filename_v0_0_2.json +89 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/swf_filename_v0_0_0.json +48 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/swf_filename_v0_0_1.json +49 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/swf_filename_v0_0_2.json +93 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/swf_filename_v0_0_3.json +99 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/tcd_filename_v0_0_0.json +48 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/vlcc_filename_v0_0_0.json +105 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/hrl/waw_filename_v0_0_0.json +48 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/n2k/n2k_filename_v1_0_0.json +43 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/pa/pa_filename_v1_0_0.json +99 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/riparian-zones/rpz_filename_v0_0_0.json +50 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/urban-atlas/ua_dhm_filename_v0_0_0.json +53 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/urban-atlas/ua_filename_v0_0_0.json +105 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/clms/urban-atlas/ua_stl_filename_v0_0_0.json +89 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/sentinel/s1_filename_v1_0_0.json +78 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/sentinel/s2_filename_v1_0_0.json +62 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/sentinel/s3_filename_v1_0_0.json +22 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/sentinel/s4_filename_v1_0_0.json +21 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/sentinel/s5p_filename_v1_0_0.json +21 -0
- parseo-0.4.4/src/parseo/schemas/copernicus/sentinel/s6_filename_v1_0_0.json +23 -0
- parseo-0.4.4/src/parseo/schemas/eumetsat/metop_filename_v1_0_0.json +68 -0
- parseo-0.4.4/src/parseo/schemas/eumetsat/mtg_filename_v1_0_0.json +65 -0
- parseo-0.4.4/src/parseo/schemas/nasa/modis_filename_v1_0_0.json +54 -0
- parseo-0.4.4/src/parseo/schemas/usgs/landsat/landsat_filename_v1_0_0.json +50 -0
- parseo-0.4.4/src/parseo/stac_http.py +267 -0
- parseo-0.4.4/src/parseo/stac_scraper.py +115 -0
- parseo-0.4.4/src/parseo/template.py +78 -0
- parseo-0.4.4/src/parseo.egg-info/PKG-INFO +402 -0
- parseo-0.4.4/src/parseo.egg-info/SOURCES.txt +83 -0
- parseo-0.4.4/src/parseo.egg-info/dependency_links.txt +1 -0
- parseo-0.4.4/src/parseo.egg-info/entry_points.txt +2 -0
- parseo-0.4.4/src/parseo.egg-info/requires.txt +13 -0
- parseo-0.4.4/src/parseo.egg-info/top_level.txt +1 -0
- parseo-0.4.4/tests/test_assembler.py +245 -0
- parseo-0.4.4/tests/test_cli.py +336 -0
- parseo-0.4.4/tests/test_init.py +21 -0
- parseo-0.4.4/tests/test_parser.py +479 -0
- parseo-0.4.4/tests/test_schema_examples_round_trip.py +16 -0
- parseo-0.4.4/tests/test_schema_registry.py +41 -0
- parseo-0.4.4/tests/test_stac_http.py +398 -0
- parseo-0.4.4/tests/test_stac_map_alignment.py +144 -0
- parseo-0.4.4/tests/test_stac_scraper.py +180 -0
parseo-0.4.4/LICENSE.txt
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
EUROPEAN UNION PUBLIC LICENCE v. 1.2
|
|
2
|
+
EUPL © the European Union 2007, 2016
|
|
3
|
+
|
|
4
|
+
This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
|
|
5
|
+
below) which is provided under the terms of this Licence. Any use of the Work,
|
|
6
|
+
other than as authorised under this Licence is prohibited (to the extent such
|
|
7
|
+
use is covered by a right of the copyright holder of the Work).
|
|
8
|
+
|
|
9
|
+
The Work is provided under the terms of this Licence when the Licensor (as
|
|
10
|
+
defined below) has placed the following notice immediately following the
|
|
11
|
+
copyright notice for the Work:
|
|
12
|
+
|
|
13
|
+
Licensed under the EUPL
|
|
14
|
+
|
|
15
|
+
or has expressed by any other means his willingness to license under the EUPL.
|
|
16
|
+
|
|
17
|
+
1. Definitions
|
|
18
|
+
|
|
19
|
+
In this Licence, the following terms have the following meaning:
|
|
20
|
+
|
|
21
|
+
- ‘The Licence’: this Licence.
|
|
22
|
+
|
|
23
|
+
- ‘The Original Work’: the work or software distributed or communicated by the
|
|
24
|
+
Licensor under this Licence, available as Source Code and also as Executable
|
|
25
|
+
Code as the case may be.
|
|
26
|
+
|
|
27
|
+
- ‘Derivative Works’: the works or software that could be created by the
|
|
28
|
+
Licensee, based upon the Original Work or modifications thereof. This Licence
|
|
29
|
+
does not define the extent of modification or dependence on the Original Work
|
|
30
|
+
required in order to classify a work as a Derivative Work; this extent is
|
|
31
|
+
determined by copyright law applicable in the country mentioned in Article 15.
|
|
32
|
+
|
|
33
|
+
- ‘The Work’: the Original Work or its Derivative Works.
|
|
34
|
+
|
|
35
|
+
- ‘The Source Code’: the human-readable form of the Work which is the most
|
|
36
|
+
convenient for people to study and modify.
|
|
37
|
+
|
|
38
|
+
- ‘The Executable Code’: any code which has generally been compiled and which is
|
|
39
|
+
meant to be interpreted by a computer as a program.
|
|
40
|
+
|
|
41
|
+
- ‘The Licensor’: the natural or legal person that distributes or communicates
|
|
42
|
+
the Work under the Licence.
|
|
43
|
+
|
|
44
|
+
- ‘Contributor(s)’: any natural or legal person who modifies the Work under the
|
|
45
|
+
Licence, or otherwise contributes to the creation of a Derivative Work.
|
|
46
|
+
|
|
47
|
+
- ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
|
|
48
|
+
the Work under the terms of the Licence.
|
|
49
|
+
|
|
50
|
+
- ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
|
|
51
|
+
renting, distributing, communicating, transmitting, or otherwise making
|
|
52
|
+
available, online or offline, copies of the Work or providing access to its
|
|
53
|
+
essential functionalities at the disposal of any other natural or legal
|
|
54
|
+
person.
|
|
55
|
+
|
|
56
|
+
2. Scope of the rights granted by the Licence
|
|
57
|
+
|
|
58
|
+
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
|
59
|
+
sublicensable licence to do the following, for the duration of copyright vested
|
|
60
|
+
in the Original Work:
|
|
61
|
+
|
|
62
|
+
- use the Work in any circumstance and for all usage,
|
|
63
|
+
- reproduce the Work,
|
|
64
|
+
- modify the Work, and make Derivative Works based upon the Work,
|
|
65
|
+
- communicate to the public, including the right to make available or display
|
|
66
|
+
the Work or copies thereof to the public and perform publicly, as the case may
|
|
67
|
+
be, the Work,
|
|
68
|
+
- distribute the Work or copies thereof,
|
|
69
|
+
- lend and rent the Work or copies thereof,
|
|
70
|
+
- sublicense rights in the Work or copies thereof.
|
|
71
|
+
|
|
72
|
+
Those rights can be exercised on any media, supports and formats, whether now
|
|
73
|
+
known or later invented, as far as the applicable law permits so.
|
|
74
|
+
|
|
75
|
+
In the countries where moral rights apply, the Licensor waives his right to
|
|
76
|
+
exercise his moral right to the extent allowed by law in order to make effective
|
|
77
|
+
the licence of the economic rights here above listed.
|
|
78
|
+
|
|
79
|
+
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
|
|
80
|
+
any patents held by the Licensor, to the extent necessary to make use of the
|
|
81
|
+
rights granted on the Work under this Licence.
|
|
82
|
+
|
|
83
|
+
3. Communication of the Source Code
|
|
84
|
+
|
|
85
|
+
The Licensor may provide the Work either in its Source Code form, or as
|
|
86
|
+
Executable Code. If the Work is provided as Executable Code, the Licensor
|
|
87
|
+
provides in addition a machine-readable copy of the Source Code of the Work
|
|
88
|
+
along with each copy of the Work that the Licensor distributes or indicates, in
|
|
89
|
+
a notice following the copyright notice attached to the Work, a repository where
|
|
90
|
+
the Source Code is easily and freely accessible for as long as the Licensor
|
|
91
|
+
continues to distribute or communicate the Work.
|
|
92
|
+
|
|
93
|
+
4. Limitations on copyright
|
|
94
|
+
|
|
95
|
+
Nothing in this Licence is intended to deprive the Licensee of the benefits from
|
|
96
|
+
any exception or limitation to the exclusive rights of the rights owners in the
|
|
97
|
+
Work, of the exhaustion of those rights or of other applicable limitations
|
|
98
|
+
thereto.
|
|
99
|
+
|
|
100
|
+
5. Obligations of the Licensee
|
|
101
|
+
|
|
102
|
+
The grant of the rights mentioned above is subject to some restrictions and
|
|
103
|
+
obligations imposed on the Licensee. Those obligations are the following:
|
|
104
|
+
|
|
105
|
+
Attribution right: The Licensee shall keep intact all copyright, patent or
|
|
106
|
+
trademarks notices and all notices that refer to the Licence and to the
|
|
107
|
+
disclaimer of warranties. The Licensee must include a copy of such notices and a
|
|
108
|
+
copy of the Licence with every copy of the Work he/she distributes or
|
|
109
|
+
communicates. The Licensee must cause any Derivative Work to carry prominent
|
|
110
|
+
notices stating that the Work has been modified and the date of modification.
|
|
111
|
+
|
|
112
|
+
Copyleft clause: If the Licensee distributes or communicates copies of the
|
|
113
|
+
Original Works or Derivative Works, this Distribution or Communication will be
|
|
114
|
+
done under the terms of this Licence or of a later version of this Licence
|
|
115
|
+
unless the Original Work is expressly distributed only under this version of the
|
|
116
|
+
Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
|
|
117
|
+
(becoming Licensor) cannot offer or impose any additional terms or conditions on
|
|
118
|
+
the Work or Derivative Work that alter or restrict the terms of the Licence.
|
|
119
|
+
|
|
120
|
+
Compatibility clause: If the Licensee Distributes or Communicates Derivative
|
|
121
|
+
Works or copies thereof based upon both the Work and another work licensed under
|
|
122
|
+
a Compatible Licence, this Distribution or Communication can be done under the
|
|
123
|
+
terms of this Compatible Licence. For the sake of this clause, ‘Compatible
|
|
124
|
+
Licence’ refers to the licences listed in the appendix attached to this Licence.
|
|
125
|
+
Should the Licensee's obligations under the Compatible Licence conflict with
|
|
126
|
+
his/her obligations under this Licence, the obligations of the Compatible
|
|
127
|
+
Licence shall prevail.
|
|
128
|
+
|
|
129
|
+
Provision of Source Code: When distributing or communicating copies of the Work,
|
|
130
|
+
the Licensee will provide a machine-readable copy of the Source Code or indicate
|
|
131
|
+
a repository where this Source will be easily and freely available for as long
|
|
132
|
+
as the Licensee continues to distribute or communicate the Work.
|
|
133
|
+
|
|
134
|
+
Legal Protection: This Licence does not grant permission to use the trade names,
|
|
135
|
+
trademarks, service marks, or names of the Licensor, except as required for
|
|
136
|
+
reasonable and customary use in describing the origin of the Work and
|
|
137
|
+
reproducing the content of the copyright notice.
|
|
138
|
+
|
|
139
|
+
6. Chain of Authorship
|
|
140
|
+
|
|
141
|
+
The original Licensor warrants that the copyright in the Original Work granted
|
|
142
|
+
hereunder is owned by him/her or licensed to him/her and that he/she has the
|
|
143
|
+
power and authority to grant the Licence.
|
|
144
|
+
|
|
145
|
+
Each Contributor warrants that the copyright in the modifications he/she brings
|
|
146
|
+
to the Work are owned by him/her or licensed to him/her and that he/she has the
|
|
147
|
+
power and authority to grant the Licence.
|
|
148
|
+
|
|
149
|
+
Each time You accept the Licence, the original Licensor and subsequent
|
|
150
|
+
Contributors grant You a licence to their contributions to the Work, under the
|
|
151
|
+
terms of this Licence.
|
|
152
|
+
|
|
153
|
+
7. Disclaimer of Warranty
|
|
154
|
+
|
|
155
|
+
The Work is a work in progress, which is continuously improved by numerous
|
|
156
|
+
Contributors. It is not a finished work and may therefore contain defects or
|
|
157
|
+
‘bugs’ inherent to this type of development.
|
|
158
|
+
|
|
159
|
+
For the above reason, the Work is provided under the Licence on an ‘as is’ basis
|
|
160
|
+
and without warranties of any kind concerning the Work, including without
|
|
161
|
+
limitation merchantability, fitness for a particular purpose, absence of defects
|
|
162
|
+
or errors, accuracy, non-infringement of intellectual property rights other than
|
|
163
|
+
copyright as stated in Article 6 of this Licence.
|
|
164
|
+
|
|
165
|
+
This disclaimer of warranty is an essential part of the Licence and a condition
|
|
166
|
+
for the grant of any rights to the Work.
|
|
167
|
+
|
|
168
|
+
8. Disclaimer of Liability
|
|
169
|
+
|
|
170
|
+
Except in the cases of wilful misconduct or damages directly caused to natural
|
|
171
|
+
persons, the Licensor will in no event be liable for any direct or indirect,
|
|
172
|
+
material or moral, damages of any kind, arising out of the Licence or of the use
|
|
173
|
+
of the Work, including without limitation, damages for loss of goodwill, work
|
|
174
|
+
stoppage, computer failure or malfunction, loss of data or any commercial
|
|
175
|
+
damage, even if the Licensor has been advised of the possibility of such damage.
|
|
176
|
+
However, the Licensor will be liable under statutory product liability laws as
|
|
177
|
+
far such laws apply to the Work.
|
|
178
|
+
|
|
179
|
+
9. Additional agreements
|
|
180
|
+
|
|
181
|
+
While distributing the Work, You may choose to conclude an additional agreement,
|
|
182
|
+
defining obligations or services consistent with this Licence. However, if
|
|
183
|
+
accepting obligations, You may act only on your own behalf and on your sole
|
|
184
|
+
responsibility, not on behalf of the original Licensor or any other Contributor,
|
|
185
|
+
and only if You agree to indemnify, defend, and hold each Contributor harmless
|
|
186
|
+
for any liability incurred by, or claims asserted against such Contributor by
|
|
187
|
+
the fact You have accepted any warranty or additional liability.
|
|
188
|
+
|
|
189
|
+
10. Acceptance of the Licence
|
|
190
|
+
|
|
191
|
+
The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
|
|
192
|
+
placed under the bottom of a window displaying the text of this Licence or by
|
|
193
|
+
affirming consent in any other similar way, in accordance with the rules of
|
|
194
|
+
applicable law. Clicking on that icon indicates your clear and irrevocable
|
|
195
|
+
acceptance of this Licence and all of its terms and conditions.
|
|
196
|
+
|
|
197
|
+
Similarly, you irrevocably accept this Licence and all of its terms and
|
|
198
|
+
conditions by exercising any rights granted to You by Article 2 of this Licence,
|
|
199
|
+
such as the use of the Work, the creation by You of a Derivative Work or the
|
|
200
|
+
Distribution or Communication by You of the Work or copies thereof.
|
|
201
|
+
|
|
202
|
+
11. Information to the public
|
|
203
|
+
|
|
204
|
+
In case of any Distribution or Communication of the Work by means of electronic
|
|
205
|
+
communication by You (for example, by offering to download the Work from a
|
|
206
|
+
remote location) the distribution channel or media (for example, a website) must
|
|
207
|
+
at least provide to the public the information requested by the applicable law
|
|
208
|
+
regarding the Licensor, the Licence and the way it may be accessible, concluded,
|
|
209
|
+
stored and reproduced by the Licensee.
|
|
210
|
+
|
|
211
|
+
12. Termination of the Licence
|
|
212
|
+
|
|
213
|
+
The Licence and the rights granted hereunder will terminate automatically upon
|
|
214
|
+
any breach by the Licensee of the terms of the Licence.
|
|
215
|
+
|
|
216
|
+
Such a termination will not terminate the licences of any person who has
|
|
217
|
+
received the Work from the Licensee under the Licence, provided such persons
|
|
218
|
+
remain in full compliance with the Licence.
|
|
219
|
+
|
|
220
|
+
13. Miscellaneous
|
|
221
|
+
|
|
222
|
+
Without prejudice of Article 9 above, the Licence represents the complete
|
|
223
|
+
agreement between the Parties as to the Work.
|
|
224
|
+
|
|
225
|
+
If any provision of the Licence is invalid or unenforceable under applicable
|
|
226
|
+
law, this will not affect the validity or enforceability of the Licence as a
|
|
227
|
+
whole. Such provision will be construed or reformed so as necessary to make it
|
|
228
|
+
valid and enforceable.
|
|
229
|
+
|
|
230
|
+
The European Commission may publish other linguistic versions or new versions of
|
|
231
|
+
this Licence or updated versions of the Appendix, so far this is required and
|
|
232
|
+
reasonable, without reducing the scope of the rights granted by the Licence. New
|
|
233
|
+
versions of the Licence will be published with a unique version number.
|
|
234
|
+
|
|
235
|
+
All linguistic versions of this Licence, approved by the European Commission,
|
|
236
|
+
have identical value. Parties can take advantage of the linguistic version of
|
|
237
|
+
their choice.
|
|
238
|
+
|
|
239
|
+
14. Jurisdiction
|
|
240
|
+
|
|
241
|
+
Without prejudice to specific agreement between parties,
|
|
242
|
+
|
|
243
|
+
- any litigation resulting from the interpretation of this License, arising
|
|
244
|
+
between the European Union institutions, bodies, offices or agencies, as a
|
|
245
|
+
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
|
|
246
|
+
of Justice of the European Union, as laid down in article 272 of the Treaty on
|
|
247
|
+
the Functioning of the European Union,
|
|
248
|
+
|
|
249
|
+
- any litigation arising between other parties and resulting from the
|
|
250
|
+
interpretation of this License, will be subject to the exclusive jurisdiction
|
|
251
|
+
of the competent court where the Licensor resides or conducts its primary
|
|
252
|
+
business.
|
|
253
|
+
|
|
254
|
+
15. Applicable Law
|
|
255
|
+
|
|
256
|
+
Without prejudice to specific agreement between parties,
|
|
257
|
+
|
|
258
|
+
- this Licence shall be governed by the law of the European Union Member State
|
|
259
|
+
where the Licensor has his seat, resides or has his registered office,
|
|
260
|
+
|
|
261
|
+
- this licence shall be governed by Belgian law if the Licensor has no seat,
|
|
262
|
+
residence or registered office inside a European Union Member State.
|
|
263
|
+
|
|
264
|
+
Appendix
|
|
265
|
+
|
|
266
|
+
‘Compatible Licences’ according to Article 5 EUPL are:
|
|
267
|
+
|
|
268
|
+
- GNU General Public License (GPL) v. 2, v. 3
|
|
269
|
+
- GNU Affero General Public License (AGPL) v. 3
|
|
270
|
+
- Open Software License (OSL) v. 2.1, v. 3.0
|
|
271
|
+
- Eclipse Public License (EPL) v. 1.0
|
|
272
|
+
- CeCILL v. 2.0, v. 2.1
|
|
273
|
+
- Mozilla Public Licence (MPL) v. 2
|
|
274
|
+
- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
|
275
|
+
- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
|
|
276
|
+
works other than software
|
|
277
|
+
- European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
|
278
|
+
- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
|
|
279
|
+
Reciprocity (LiLiQ-R+).
|
|
280
|
+
|
|
281
|
+
The European Commission may update this Appendix to later versions of the above
|
|
282
|
+
licences without producing a new version of the EUPL, as long as they provide
|
|
283
|
+
the rights granted in Article 2 of this Licence and protect the covered Source
|
|
284
|
+
Code from exclusive appropriation.
|
|
285
|
+
|
|
286
|
+
All other changes or additions to this Appendix require the production of a new
|
|
287
|
+
EUPL version.
|
parseo-0.4.4/MANIFEST.in
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include src/parseo/schemas *filename_v*.json
|
parseo-0.4.4/PKG-INFO
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: parseo
|
|
3
|
+
Version: 0.4.4
|
|
4
|
+
Summary: Filename parser/assembler for satellite data
|
|
5
|
+
Author-email: Matteo Mattiuzzi <matteo@mattiuzzi.com>
|
|
6
|
+
License: EUPL-1.2
|
|
7
|
+
Project-URL: Homepage, https://github.com/copernicus-land/parsEO
|
|
8
|
+
Project-URL: Repository, https://github.com/copernicus-land/parsEO.git
|
|
9
|
+
Project-URL: Issues, https://github.com/copernicus-land/parsEO/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/copernicus-land/parsEO/releases
|
|
11
|
+
Keywords: satellite,remote-sensing,filenames,sentinel,parsing
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE.txt
|
|
25
|
+
Requires-Dist: build>=1.4.4
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: build; extra == "dev"
|
|
28
|
+
Requires-Dist: twine; extra == "dev"
|
|
29
|
+
Requires-Dist: ruff; extra == "dev"
|
|
30
|
+
Requires-Dist: mypy; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
33
|
+
Provides-Extra: web
|
|
34
|
+
Requires-Dist: fastapi; extra == "web"
|
|
35
|
+
Requires-Dist: uvicorn; extra == "web"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
::: {align="center"}
|
|
39
|
+
# parsEO
|
|
40
|
+
|
|
41
|
+
**parsEO** is a Python toolkit that parses existing Earth Observation filenames into structured metadata and assembles new filenames from validated fields. Filename rules live in JSON schemas, turning the repository into a single source of truth for product nomenclature.
|
|
42
|
+
:::
|
|
43
|
+
|
|
44
|
+
## Why parsEO?
|
|
45
|
+
|
|
46
|
+
- **Bidirectional workflows** – convert filenames to Python dictionaries and rebuild filenames from the same fields.
|
|
47
|
+
- **Schema-driven** – JSON schemas define every product token, validation rule, and STAC link. Drop in a new schema file and it is discovered automatically.
|
|
48
|
+
- **Extensible** – contributions focus on data, not glue code. Adding support for a new mission only requires a schema.
|
|
49
|
+
|
|
50
|
+
## Supported product families
|
|
51
|
+
|
|
52
|
+
- **Sentinel missions** – S1, S2, S3, S4, S5P, S6
|
|
53
|
+
- **Landsat** – LT04, LT05, LE07, LC08, LC09
|
|
54
|
+
- **NASA MODIS** – Terra and Aqua MODIS products
|
|
55
|
+
- **EUMETSAT missions** – MTG, Metop
|
|
56
|
+
- **Copernicus Land Monitoring Service (CLMS)**
|
|
57
|
+
- Corine Land Cover (CLC) and CLC+ Raster
|
|
58
|
+
- European Ground Motion Service (EGMS) Level 2 basic/calibrated products, Level 3 velocity grid, and GNSS model
|
|
59
|
+
- Urban Atlas Land Cover / Land Use
|
|
60
|
+
- High Resolution Vegetation Phenology & Productivity (HR-VPP): Seasonal Trajectories (PPI) and Vegetation Indices (FAPAR, LAI, NDVI, PPI, FCOVER, DMP)
|
|
61
|
+
- High Resolution Water & Snow / Ice (HR-WSI): CC, FSC, GFSC, ICD, SWS, WDS, WIC, WIC-COMB, SP_S2, SP_COMB
|
|
62
|
+
- High Resolution Layers (HRL): Forest Type, Grassland, Imperviousness, Non-Vegetated Land Cover Characteristics, Tree Cover Density, Water & Wetness, Small Woody Features
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
``` bash
|
|
67
|
+
pip install parseo
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For development installs:
|
|
71
|
+
|
|
72
|
+
``` bash
|
|
73
|
+
git clone https://github.com/copernicus-land/parsEO.git
|
|
74
|
+
cd parsEO
|
|
75
|
+
pip install -e .
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Confirm the CLI is available:
|
|
79
|
+
|
|
80
|
+
``` bash
|
|
81
|
+
parseo --version
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Quick start
|
|
85
|
+
|
|
86
|
+
### Parse a filename
|
|
87
|
+
|
|
88
|
+
``` python
|
|
89
|
+
from parseo import parse_auto
|
|
90
|
+
|
|
91
|
+
name = "S2B_MSIL2A_20241123T224759_N0511_R101_T03VUL_20241123T230829.SAFE"
|
|
92
|
+
result = parse_auto(name)
|
|
93
|
+
|
|
94
|
+
print(result.valid) # True
|
|
95
|
+
print(result.fields) # structured dict of extracted fields
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Another example using a MODIS filename:
|
|
99
|
+
|
|
100
|
+
``` python
|
|
101
|
+
from parseo import parse_auto
|
|
102
|
+
|
|
103
|
+
name = "MOD09GA.A2021123.h18v04.006.2021132234506.hdf"
|
|
104
|
+
result = parse_auto(name)
|
|
105
|
+
|
|
106
|
+
print(result.fields["platform"]) # MOD
|
|
107
|
+
print(result.fields["product"]) # 09
|
|
108
|
+
print(result.fields["variant"]) # GA
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The MODIS schema advertises the Processing, Sat, Raster, and Electro-Optical STAC extensions, enabling automated STAC metadata generation (`processing`, `sat`, `raster`, `eo`).
|
|
112
|
+
|
|
113
|
+
### Assemble a filename
|
|
114
|
+
|
|
115
|
+
``` python
|
|
116
|
+
from parseo import assemble, assemble_auto
|
|
117
|
+
|
|
118
|
+
fields = {
|
|
119
|
+
"platform": "S2B",
|
|
120
|
+
"instrument": "MSI",
|
|
121
|
+
"processing_level": "L2A",
|
|
122
|
+
"sensing_datetime": "20241123T224759",
|
|
123
|
+
"processing_baseline": "N0511",
|
|
124
|
+
"relative_orbit": "R101",
|
|
125
|
+
"tile_id": "T03VUL", # MGRS tile (TxxYYY, e.g. T32TNS)
|
|
126
|
+
"generation_datetime": "20241123T230829",
|
|
127
|
+
"extension": "SAFE",
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
assemble_auto(fields)
|
|
131
|
+
# 'S2B_MSIL2A_20241123T224759_N0511_R101_T03VUL_20241123T230829.SAFE'
|
|
132
|
+
|
|
133
|
+
assemble(fields, family="S2")
|
|
134
|
+
# Uses the default (current) Sentinel-2 schema for quicker resolution.
|
|
135
|
+
|
|
136
|
+
assemble(fields, family="S2", version="1.0.0")
|
|
137
|
+
# Lock both family and schema version explicitly.
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
To force a specific schema file:
|
|
141
|
+
|
|
142
|
+
``` python
|
|
143
|
+
from pathlib import Path
|
|
144
|
+
from parseo import assemble
|
|
145
|
+
|
|
146
|
+
schema_path = Path("src/parseo/schemas/copernicus/sentinel/s2/s2_filename_v1_0_0.json")
|
|
147
|
+
filename = assemble(fields, schema_path=schema_path)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`parse_auto` reports the schema version and lifecycle status that were used:
|
|
151
|
+
|
|
152
|
+
``` python
|
|
153
|
+
from parseo import parse_auto
|
|
154
|
+
|
|
155
|
+
result = parse_auto("S2B_MSIL2A_20241123T224759_N0511_R101_T03VUL_20241123T230829.SAFE")
|
|
156
|
+
print(result.version) # '1.0.0'
|
|
157
|
+
print(result.status) # 'current'
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Command-line interface
|
|
161
|
+
|
|
162
|
+
The same functionality is exposed through the CLI.
|
|
163
|
+
|
|
164
|
+
``` bash
|
|
165
|
+
# Parse a filename
|
|
166
|
+
parseo parse S2B_MSIL2A_20241123T224759_N0511_R101_T03VUL_20241123T230829.SAFE
|
|
167
|
+
|
|
168
|
+
# Parse a Copernicus Land Monitoring Service (CLMS) filename
|
|
169
|
+
parseo parse ST_20240101T123045_S2_E15N45-03035-010m_V100_PPI.tif
|
|
170
|
+
|
|
171
|
+
# Parse and write the JSON response to a file
|
|
172
|
+
parseo parse ST_20240101T123045_S2_E15N45-03035-010m_V100_PPI.tif --output result.json
|
|
173
|
+
|
|
174
|
+
# Assemble from the saved JSON document. The CLI automatically
|
|
175
|
+
# extracts the `fields` entry produced by `parseo parse`.
|
|
176
|
+
cat result.json | parseo assemble --family copernicus:clms:hr-vpp:st --fields-json -
|
|
177
|
+
|
|
178
|
+
# Pipe the parse result directly into assemble
|
|
179
|
+
parseo parse ST_20240101T123045_S2_E15N45-03035-010m_V100_PPI.tif \
|
|
180
|
+
| parseo assemble --family copernicus:clms:hr-vpp:st
|
|
181
|
+
|
|
182
|
+
# Assemble the same CLMS filename from key=value pairs
|
|
183
|
+
parseo assemble
|
|
184
|
+
product=ST
|
|
185
|
+
timestamp=20240101T123045
|
|
186
|
+
sensor=S2
|
|
187
|
+
tile_id=E15N45
|
|
188
|
+
epsg_code=03035
|
|
189
|
+
resolution=010m
|
|
190
|
+
version=V100
|
|
191
|
+
variable=PPI
|
|
192
|
+
extension=tif
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Discover available schemas
|
|
196
|
+
|
|
197
|
+
List every schema that ships with parsEO, including its fully qualified `schema_id`, semantic version, lifecycle status, and file location:
|
|
198
|
+
|
|
199
|
+
``` bash
|
|
200
|
+
parseo list-schemas
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The command prints a table summarizing all discovered schemas, making it easy to confirm which versions are available before parsing or assembling filenames. The first column shows the complete namespace (for example `copernicus:clms:hrl:vlcc`), so you can see exactly where a product sits inside the Copernicus hierarchy.
|
|
204
|
+
|
|
205
|
+
List only the schemas that are marked as `current` with the built-in filter (works on every platform):
|
|
206
|
+
|
|
207
|
+
``` bash
|
|
208
|
+
parseo list-schemas --status current
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
To inspect a single family in the summary table, provide the short family name explicitly. You can also pass a namespace prefix to see every schema beneath it:
|
|
212
|
+
|
|
213
|
+
``` bash
|
|
214
|
+
parseo list-schemas --family S2
|
|
215
|
+
parseo list-schemas --family copernicus
|
|
216
|
+
parseo list-schemas --family copernicus:clms:hrl
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
For the full schema metadata (fields, examples, etc.), use `schema-info`:
|
|
220
|
+
|
|
221
|
+
``` bash
|
|
222
|
+
parseo schema-info S2
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The JSON response includes the schema's semantic version and lifecycle status so
|
|
226
|
+
you can immediately tell which release you are viewing. To inspect an archived
|
|
227
|
+
version, provide the version number explicitly:
|
|
228
|
+
|
|
229
|
+
``` bash
|
|
230
|
+
parseo schema-info --version 1.0.0 CLC
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Working with specific schema versions
|
|
234
|
+
|
|
235
|
+
When multiple schema versions are present, parsEO chooses the one whose `status` is `"current"`. If none are marked current, the highest `schema_version` wins. You can inspect historical schemas with `parseo schema-info --version <x.y.z> <family>` and you can always pin a schema by passing `schema_path` to `assemble` or `parse`.
|
|
236
|
+
|
|
237
|
+
## Authoring new Schema
|
|
238
|
+
|
|
239
|
+
Adding a schema requires only a JSON document under `src/parseo/schemas/`. Start from an existing product schema or the skeleton in `template/`.
|
|
240
|
+
|
|
241
|
+
- **Create the product directory** – `src/parseo/schemas/<family>/<mission>/<product>/` (only the family level is mandatory).
|
|
242
|
+
|
|
243
|
+
- **Write the versioned schema file** – `<product>_filename_vX_Y_Z.json` with required metadata (`schema_id`, `schema_version`, `status`, optional `stac_version`, `stac_extensions`, and `description`).
|
|
244
|
+
|
|
245
|
+
- **Maintain versions** — mark the latest schema as `"current"` and move older ones to `"deprecated"` (or similar). parsEO uses these flags to pick defaults.
|
|
246
|
+
|
|
247
|
+
**Schema versioning policy:** Schemas at version `0.0.0` are provisional — their patterns and field definitions may change without notice. Once a product's naming convention is finalised (typically when it reaches CDSE production), the schema should be promoted to `1.0.0` to signal a stable, supported contract.
|
|
248
|
+
|
|
249
|
+
### Container Object `fields`
|
|
250
|
+
|
|
251
|
+
**`fields`** is a container object to define filename tokens and translation mechanisms from/to STAC. Each `property` combines JSON Schema keywords (`type`, `pattern`, `enum`, …) and optional documentation. The `property name` is the variable name used by the `template` container and unless a `stac_map` is applied also what is retrieved by `parseo parse` or fed into `parseo assemble`.
|
|
252
|
+
|
|
253
|
+
``` json
|
|
254
|
+
"fields": {
|
|
255
|
+
"property-1": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"enum": ["A","B"],
|
|
258
|
+
"description": "descripton of property 1"
|
|
259
|
+
},
|
|
260
|
+
"property-2": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"pattern": "^(\d{8}T\d{6})$",
|
|
263
|
+
"description": "descripton of property 2"
|
|
264
|
+
},
|
|
265
|
+
...
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### `type`
|
|
270
|
+
|
|
271
|
+
The keyword `type` is currently set to "string" by default, and used as best practice.
|
|
272
|
+
|
|
273
|
+
#### `enum` or `pattern`
|
|
274
|
+
|
|
275
|
+
- Use `enum` for short, controlled vocabularies such as file extensions or processing modes (`["A","B"]`). It keeps validation strict and self-documenting.
|
|
276
|
+
- Use `pattern` for structured tokens like timestamps (`^\d{8}T\d{6}$`), version identifiers (`^V\d{3}$`), or grid identifiers (`^h\d{2}v\d{2}$`).
|
|
277
|
+
|
|
278
|
+
#### `oneOf`
|
|
279
|
+
|
|
280
|
+
Use `oneOf` to express mutually exclusive validation branches for a single field. Each branch can provide its own JSON Schema keywords, enabling concise modelling of tokens that admit multiple formats. For example, a `variant` token may allow either a fixed set of legacy values or a future-proof pattern:
|
|
281
|
+
|
|
282
|
+
``` json
|
|
283
|
+
"variant": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"oneOf": [
|
|
286
|
+
{"enum": ["A", "B", "C"]},
|
|
287
|
+
{"pattern": "^X\d{2}$"},
|
|
288
|
+
{"pattern": "^z\d{4}$"}
|
|
289
|
+
],
|
|
290
|
+
"description": "Legacy letters or experimental codes"
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
When `parseo parse` runs, the value is checked against each branch in order until one succeeds. `parseo assemble` accepts any value satisfying at least one branch, allowing schemas to stay expressive without duplicating fields.
|
|
295
|
+
|
|
296
|
+
#### `stac_map`
|
|
297
|
+
|
|
298
|
+
Functionality to connect filename tokens to STAC properties in case of incompatibility. In the following example `parseo parse` matches the filename field `prefix` but returns the STAC compliant `platform` and `instrument`. `parseo assemble` must be provided with `platform` and `instrument` and converts it to the correct `prefix` as defined by the filename `template`.
|
|
299
|
+
|
|
300
|
+
``` json
|
|
301
|
+
"prefix": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"pattern": "^(MOD|MYD|MCD)$",
|
|
304
|
+
"stac_map": {
|
|
305
|
+
"MOD": {
|
|
306
|
+
"platform": "Terra",
|
|
307
|
+
"instrument": "MODIS"
|
|
308
|
+
},
|
|
309
|
+
"MYD": {
|
|
310
|
+
"platform": "Aqua",
|
|
311
|
+
"instrument": "MODIS"
|
|
312
|
+
},
|
|
313
|
+
"MCD": {
|
|
314
|
+
"platform": "Combined",
|
|
315
|
+
"instrument": "MODIS"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
#### Container Object `template`
|
|
323
|
+
A filename is assembled/parsed based on the definition put into `template` container object. E.g.:
|
|
324
|
+
|
|
325
|
+
``` json
|
|
326
|
+
"template": "{variable}-C{reference_year}_R{resolution}_{tile_id}{epsg_code}_{version}[.{extension}]"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
`fields` are added to the `template` using the `{property name}`. The template further decides for the fields are arranged and how they are separated from each other. Further it is possible to ad permanent elements as well, e.g. adding a prefix `C` to the `{reference_year} = C{reference_year}` to match e.g. 'C2012'. This can be particularly useful if you are interested in only parts of the field, e.g. by doping `EPSG{epsg_code}` you fetch only the code itself. This can also be a regex, e.g. `..._(S|C){reference_year}_...`.
|
|
330
|
+
|
|
331
|
+
Optional filenames must be encapsulated in `[]`. E.g. `[.{extension}]`
|
|
332
|
+
|
|
333
|
+
#### Container Object `examples`
|
|
334
|
+
|
|
335
|
+
Populate `"examples"` with valid filenames covering typical combinations of optional tokens. Test routines will run the examples to assess the proper functioning.
|
|
336
|
+
|
|
337
|
+
### Test round-trips
|
|
338
|
+
|
|
339
|
+
run `parseo parse <filename>` and `parseo assemble --schema <schema_path>` to confirm the schema behaves as expected.
|
|
340
|
+
|
|
341
|
+
### Run unit tests
|
|
342
|
+
|
|
343
|
+
Install the pytest python package.
|
|
344
|
+
|
|
345
|
+
from the top-level directory, run `pytest` to launch all tests, or e.g `pytest tests/test_schema_examples_round_trip.py`
|
|
346
|
+
|
|
347
|
+
### Run as API
|
|
348
|
+
|
|
349
|
+
parsEO functions can be exposed through a web service. The example below uses [FastAPI](https://fastapi.tiangolo.com), which provides an automatic Swagger UI for trying out the endpoints.
|
|
350
|
+
|
|
351
|
+
``` python
|
|
352
|
+
# Safe to file: main.py
|
|
353
|
+
from fastapi import FastAPI
|
|
354
|
+
from parseo import assemble, parse_auto
|
|
355
|
+
|
|
356
|
+
app = FastAPI()
|
|
357
|
+
|
|
358
|
+
@app.get("/parse")
|
|
359
|
+
def parse_endpoint(name: str):
|
|
360
|
+
res = parse_auto(name)
|
|
361
|
+
return res
|
|
362
|
+
|
|
363
|
+
@app.post("/assemble")
|
|
364
|
+
def assemble_endpoint(schema: str, fields: dict):
|
|
365
|
+
filename = assemble(fields, schema_path=schema)
|
|
366
|
+
return {"filename": filename}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Install fastapi and uvicorn (in a python virtual environment):
|
|
370
|
+
|
|
371
|
+
``` bash
|
|
372
|
+
python3 -m venv .venv
|
|
373
|
+
source .venv/bin/activate
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Install the required dependencies (fastapi and uvicorn):
|
|
377
|
+
|
|
378
|
+
``` bash
|
|
379
|
+
(.venv) pip install fastapi uvicorn[standard]
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
from the console inside the same directory start the app:
|
|
383
|
+
|
|
384
|
+
``` bash
|
|
385
|
+
(.venv) python -m uvicorn main:app --reload
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Open <http://127.0.0.1:8000/docs> to access Swagger UI:
|
|
389
|
+
|
|
390
|
+
The interactive page lets you call `/parse` and `/assemble` directly from the browser to verify the API.
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
## Contributing
|
|
394
|
+
|
|
395
|
+
- Place new schemas under `src/parseo/schemas/<product_family>/`.
|
|
396
|
+
- Include at least one positive example in each schema file.
|
|
397
|
+
- Run the test-suite with `pytest` (and `ruff check .` for linting) before opening a pull request.
|
|
398
|
+
- Submit a pull request describing the new products or fixes.
|
|
399
|
+
|
|
400
|
+
## License
|
|
401
|
+
|
|
402
|
+
This project is licensed under the [European Union Public Licence v1.2](LICENSE.txt).
|