collekt 0.2.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.
- collekt-0.2.0/LICENSE +28 -0
- collekt-0.2.0/PKG-INFO +175 -0
- collekt-0.2.0/README.md +133 -0
- collekt-0.2.0/pyproject.toml +129 -0
- collekt-0.2.0/pyproject.toml.orig +122 -0
- collekt-0.2.0/src/collekt/__init__.py +54 -0
- collekt-0.2.0/src/collekt/assemble/__init__.py +10 -0
- collekt-0.2.0/src/collekt/assemble/gridded.py +823 -0
- collekt-0.2.0/src/collekt/cli/__init__.py +3 -0
- collekt-0.2.0/src/collekt/cli/commands/__init__.py +13 -0
- collekt-0.2.0/src/collekt/cli/commands/config.py +26 -0
- collekt-0.2.0/src/collekt/cli/commands/doctor.py +33 -0
- collekt-0.2.0/src/collekt/cli/commands/fetch.py +108 -0
- collekt-0.2.0/src/collekt/cli/main.py +46 -0
- collekt-0.2.0/src/collekt/conf/default.yaml +21 -0
- collekt-0.2.0/src/collekt/conf/source/cmems_global.yaml +176 -0
- collekt-0.2.0/src/collekt/conf/source/cmems_ibi.yaml +94 -0
- collekt-0.2.0/src/collekt/conf/source/cmems_med.yaml +148 -0
- collekt-0.2.0/src/collekt/conf/source/cmems_nws.yaml +73 -0
- collekt-0.2.0/src/collekt/conf/source/dataspace.yaml +27 -0
- collekt-0.2.0/src/collekt/conf/source/ecmwf.yaml +55 -0
- collekt-0.2.0/src/collekt/conf/source/eodyn.yaml +27 -0
- collekt-0.2.0/src/collekt/conf/source/hozint.yaml +11 -0
- collekt-0.2.0/src/collekt/conf/source/skytruth.yaml +12 -0
- collekt-0.2.0/src/collekt/core/__init__.py +0 -0
- collekt-0.2.0/src/collekt/core/availability.py +379 -0
- collekt-0.2.0/src/collekt/core/catalog.py +120 -0
- collekt-0.2.0/src/collekt/core/collect.py +126 -0
- collekt-0.2.0/src/collekt/core/config/__init__.py +40 -0
- collekt-0.2.0/src/collekt/core/config/loader.py +145 -0
- collekt-0.2.0/src/collekt/core/config/schema.py +254 -0
- collekt-0.2.0/src/collekt/core/datasets.py +262 -0
- collekt-0.2.0/src/collekt/core/diagnostics.py +45 -0
- collekt-0.2.0/src/collekt/core/doctor.py +72 -0
- collekt-0.2.0/src/collekt/core/exporting.py +72 -0
- collekt-0.2.0/src/collekt/core/fetcher.py +185 -0
- collekt-0.2.0/src/collekt/core/geo.py +55 -0
- collekt-0.2.0/src/collekt/core/manifest.py +167 -0
- collekt-0.2.0/src/collekt/core/naming.py +62 -0
- collekt-0.2.0/src/collekt/core/reporting.py +97 -0
- collekt-0.2.0/src/collekt/core/request.py +200 -0
- collekt-0.2.0/src/collekt/core/result.py +41 -0
- collekt-0.2.0/src/collekt/core/temporal.py +76 -0
- collekt-0.2.0/src/collekt/resources/.gitignore +0 -0
- collekt-0.2.0/src/collekt/resources/regions/norway.geojson +171 -0
- collekt-0.2.0/src/collekt/resources/schema/manifest.schema.json +104 -0
- collekt-0.2.0/src/collekt/sources/__init__.py +21 -0
- collekt-0.2.0/src/collekt/sources/base.py +138 -0
- collekt-0.2.0/src/collekt/sources/cmems.py +410 -0
- collekt-0.2.0/src/collekt/sources/copernicus_dataspace.py +240 -0
- collekt-0.2.0/src/collekt/sources/ecmwf_open_data.py +318 -0
- collekt-0.2.0/src/collekt/sources/eodyn.py +360 -0
- collekt-0.2.0/src/collekt/sources/era5.py +198 -0
- collekt-0.2.0/src/collekt/sources/hozint.py +137 -0
- collekt-0.2.0/src/collekt/sources/planning.py +134 -0
- collekt-0.2.0/src/collekt/sources/skytruth.py +276 -0
- collekt-0.2.0/src/collekt/sources/skytruth.spec.yaml +135 -0
- collekt-0.2.0/src/collekt/version.py +4 -0
collekt-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
3-Clause BSD License / New BSD License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2025 Simula Research Laboratory, Oslo, Norway
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
16
|
+
may be used to endorse or promote products derived from this software without
|
|
17
|
+
specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
collekt-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: collekt
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A library to facilitate spatio-temporal data collection across arbitrary datasources
|
|
5
|
+
Keywords: data source,collection
|
|
6
|
+
Author: Thomas Roehr, Ola Formo Kihle, Julien Vitay
|
|
7
|
+
Author-email: Thomas Roehr <roehr@simula.no>, Ola Formo Kihle <kihle@simula.no>, Julien Vitay <julien.vitay@eodyn.com>
|
|
8
|
+
License-Expression: BSD-3-Clause
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Requires-Dist: pydantic
|
|
16
|
+
Requires-Dist: pydantic-settings
|
|
17
|
+
Requires-Dist: pyyaml
|
|
18
|
+
Requires-Dist: requests
|
|
19
|
+
Requires-Dist: shapely
|
|
20
|
+
Requires-Dist: geopy
|
|
21
|
+
Requires-Dist: rich
|
|
22
|
+
Requires-Dist: tqdm
|
|
23
|
+
Requires-Dist: xarray>=2026.4.0
|
|
24
|
+
Requires-Dist: scipy>=1.18.0
|
|
25
|
+
Requires-Dist: cfgrib>=0.9.15.1
|
|
26
|
+
Requires-Dist: eccodeslib>=2.47.3.21
|
|
27
|
+
Requires-Dist: damast
|
|
28
|
+
Requires-Dist: geopandas
|
|
29
|
+
Requires-Dist: polars
|
|
30
|
+
Requires-Dist: copernicusmarine>=2.4.1
|
|
31
|
+
Requires-Dist: cdsapi>=0.7.7
|
|
32
|
+
Requires-Dist: ecmwf-opendata>=0.3.30
|
|
33
|
+
Requires-Dist: hozint-apiclient
|
|
34
|
+
Requires-Dist: python-dotenv>=1.2.2
|
|
35
|
+
Maintainer: Thomas Roehr
|
|
36
|
+
Maintainer-email: Thomas Roehr <roehr@simula.no>
|
|
37
|
+
Requires-Python: >=3.13
|
|
38
|
+
Project-URL: homepage, https://ai4copsec.github.io/collekt
|
|
39
|
+
Project-URL: documentation, https://ai4copsec.github.io/collekt
|
|
40
|
+
Project-URL: repository, https://github.com/ai4copsec/collekt
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
|
|
43
|
+
# collekt
|
|
44
|
+
|
|
45
|
+
A library to facilitate spatio-temporal data collection across arbitrary
|
|
46
|
+
datasources.
|
|
47
|
+
|
|
48
|
+
A dataset config names the products to fetch, and a request supplies the region,
|
|
49
|
+
time window, and metadata. The selected products are fanned out to
|
|
50
|
+
pluggable source adapters.
|
|
51
|
+
Each adapter fetches source-native files (NetCDF, GRIB2, Parquet, product
|
|
52
|
+
archives) and records what it did in a machine-readable manifest. Gridded results
|
|
53
|
+
can then be assembled onto a common grid and time axis.
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
Requires Python 3.13+ and [`uv`](https://docs.astral.sh/uv/).
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git clone https://github.com/ai4copsec/collekt.git
|
|
61
|
+
cd collekt
|
|
62
|
+
uv sync --all-groups # or: just install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
All provider clients and the gridded `Assembler` are installed by default, so
|
|
66
|
+
every source works out of the box. Clients are imported lazily, so importing
|
|
67
|
+
collekt stays fast.
|
|
68
|
+
|
|
69
|
+
To build the documentation locally, you will also need the `quarto` binary ([quarto.org](https://quarto.org/)):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
just docs
|
|
73
|
+
# or :
|
|
74
|
+
uv run quartodoc build --config docs/_quarto.yml
|
|
75
|
+
quarto render docs
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
We recommend using `just` (<https://github.com/casey/just>) with the make-like commands available in `justfile`.
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
### Python
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import collekt
|
|
86
|
+
|
|
87
|
+
config = collekt.DatasetConfig(
|
|
88
|
+
collekt.CMEMS("cmems_glorys_my", variables=["uo", "vo"], depth=[1.0, 1.1]),
|
|
89
|
+
collekt.CMEMS("cmems_duacs_my", variables=["ugos", "vgos"]),
|
|
90
|
+
collekt.CMEMS("cmems_med_currents_my", variables=["uo", "vo"], depth=[1.0, 1.1]),
|
|
91
|
+
)
|
|
92
|
+
request = collekt.Request(
|
|
93
|
+
region=collekt.Region.from_bbox((-6.0, 20.0, 35.0, 45.0)),
|
|
94
|
+
start="2023-06-15",
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
fetcher = collekt.Fetcher(request=request, config=config, output_dir="data/collections")
|
|
98
|
+
result = fetcher.download()
|
|
99
|
+
print(result.manifest_path)
|
|
100
|
+
|
|
101
|
+
# Assemble gridded sources onto a common grid and time axis.
|
|
102
|
+
assembler = collekt.Assembler(result)
|
|
103
|
+
dataset = assembler.to_xarray(grid="lowest_resolution", time="lowest_resolution")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`Region` can also be built from a point and radius
|
|
107
|
+
(`Region.from_point_radius(lat, lon, radius_km)`) or a GeoJSON file
|
|
108
|
+
(`Region.from_geojson(path)`).
|
|
109
|
+
|
|
110
|
+
### Command line
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
collekt config show # inspect the bundled catalog
|
|
114
|
+
collekt doctor # check the environment and configuration
|
|
115
|
+
|
|
116
|
+
cat > datasets.yaml <<'YAML'
|
|
117
|
+
datasets:
|
|
118
|
+
- provider: cmems
|
|
119
|
+
key: cmems_glorys_my
|
|
120
|
+
variables: [uo, vo]
|
|
121
|
+
depth: [1.0, 1.1]
|
|
122
|
+
- provider: cmems
|
|
123
|
+
key: cmems_duacs_my
|
|
124
|
+
variables: [ugos, vgos]
|
|
125
|
+
- provider: cmems
|
|
126
|
+
key: cmems_med_currents_my
|
|
127
|
+
variables: [uo, vo]
|
|
128
|
+
depth: [1.0, 1.1]
|
|
129
|
+
YAML
|
|
130
|
+
|
|
131
|
+
collekt fetch --bbox -6 20 35 45 --start 2023-06-15 \
|
|
132
|
+
--dataset-config datasets.yaml --output-dir data/collections
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Use `--dry-run` to plan provider requests without downloading, and `--strict` to
|
|
136
|
+
fail if any requested source is skipped.
|
|
137
|
+
|
|
138
|
+
### Sources and configuration
|
|
139
|
+
|
|
140
|
+
collekt ships a **curated catalog** of datasets (CMEMS global + Mediterranean,
|
|
141
|
+
ECMWF Open Data, ERA5, Skytruth, Copernicus Data Space, eOdyn). Select concrete
|
|
142
|
+
dataset keys with `DatasetConfig` or its YAML form, and put provider parameters
|
|
143
|
+
such as variable names and depth ranges directly on each selected dataset. See
|
|
144
|
+
[Products](https://ai4copsec.github.io/collekt/products.html) and
|
|
145
|
+
[Credentials](https://ai4copsec.github.io/collekt/credentials.html).
|
|
146
|
+
|
|
147
|
+
## Development
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
just lint # format + lint with ruff
|
|
151
|
+
just test # run the test suite
|
|
152
|
+
just docs # build the Quarto documentation
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The definition of done for any change: `just lint` and `just test` pass, with a
|
|
156
|
+
test for any behavior changed.
|
|
157
|
+
|
|
158
|
+
## Documentation
|
|
159
|
+
|
|
160
|
+
Built with [Quarto](https://quarto.org) and
|
|
161
|
+
[quartodoc](https://machow.github.io/quartodoc/) from `docs/`; the rendered site
|
|
162
|
+
is published to GitHub Pages.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
[BSD-3-Clause](LICENSE).
|
|
167
|
+
|
|
168
|
+
## Copyright
|
|
169
|
+
|
|
170
|
+
Copyright (c) 2023-2026 [Simula Research Laboratory, Oslo, Norway](https://www.simula.no).
|
|
171
|
+
|
|
172
|
+
## Acknowledgments
|
|
173
|
+
|
|
174
|
+
Part of the EU project [AI4COPSEC](https://ai4copsec.eu), funded by the Horizon
|
|
175
|
+
Europe framework programme under Grant Agreement N. 101190021.
|
collekt-0.2.0/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# collekt
|
|
2
|
+
|
|
3
|
+
A library to facilitate spatio-temporal data collection across arbitrary
|
|
4
|
+
datasources.
|
|
5
|
+
|
|
6
|
+
A dataset config names the products to fetch, and a request supplies the region,
|
|
7
|
+
time window, and metadata. The selected products are fanned out to
|
|
8
|
+
pluggable source adapters.
|
|
9
|
+
Each adapter fetches source-native files (NetCDF, GRIB2, Parquet, product
|
|
10
|
+
archives) and records what it did in a machine-readable manifest. Gridded results
|
|
11
|
+
can then be assembled onto a common grid and time axis.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Requires Python 3.13+ and [`uv`](https://docs.astral.sh/uv/).
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/ai4copsec/collekt.git
|
|
19
|
+
cd collekt
|
|
20
|
+
uv sync --all-groups # or: just install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
All provider clients and the gridded `Assembler` are installed by default, so
|
|
24
|
+
every source works out of the box. Clients are imported lazily, so importing
|
|
25
|
+
collekt stays fast.
|
|
26
|
+
|
|
27
|
+
To build the documentation locally, you will also need the `quarto` binary ([quarto.org](https://quarto.org/)):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
just docs
|
|
31
|
+
# or :
|
|
32
|
+
uv run quartodoc build --config docs/_quarto.yml
|
|
33
|
+
quarto render docs
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
We recommend using `just` (<https://github.com/casey/just>) with the make-like commands available in `justfile`.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Python
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import collekt
|
|
44
|
+
|
|
45
|
+
config = collekt.DatasetConfig(
|
|
46
|
+
collekt.CMEMS("cmems_glorys_my", variables=["uo", "vo"], depth=[1.0, 1.1]),
|
|
47
|
+
collekt.CMEMS("cmems_duacs_my", variables=["ugos", "vgos"]),
|
|
48
|
+
collekt.CMEMS("cmems_med_currents_my", variables=["uo", "vo"], depth=[1.0, 1.1]),
|
|
49
|
+
)
|
|
50
|
+
request = collekt.Request(
|
|
51
|
+
region=collekt.Region.from_bbox((-6.0, 20.0, 35.0, 45.0)),
|
|
52
|
+
start="2023-06-15",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
fetcher = collekt.Fetcher(request=request, config=config, output_dir="data/collections")
|
|
56
|
+
result = fetcher.download()
|
|
57
|
+
print(result.manifest_path)
|
|
58
|
+
|
|
59
|
+
# Assemble gridded sources onto a common grid and time axis.
|
|
60
|
+
assembler = collekt.Assembler(result)
|
|
61
|
+
dataset = assembler.to_xarray(grid="lowest_resolution", time="lowest_resolution")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`Region` can also be built from a point and radius
|
|
65
|
+
(`Region.from_point_radius(lat, lon, radius_km)`) or a GeoJSON file
|
|
66
|
+
(`Region.from_geojson(path)`).
|
|
67
|
+
|
|
68
|
+
### Command line
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
collekt config show # inspect the bundled catalog
|
|
72
|
+
collekt doctor # check the environment and configuration
|
|
73
|
+
|
|
74
|
+
cat > datasets.yaml <<'YAML'
|
|
75
|
+
datasets:
|
|
76
|
+
- provider: cmems
|
|
77
|
+
key: cmems_glorys_my
|
|
78
|
+
variables: [uo, vo]
|
|
79
|
+
depth: [1.0, 1.1]
|
|
80
|
+
- provider: cmems
|
|
81
|
+
key: cmems_duacs_my
|
|
82
|
+
variables: [ugos, vgos]
|
|
83
|
+
- provider: cmems
|
|
84
|
+
key: cmems_med_currents_my
|
|
85
|
+
variables: [uo, vo]
|
|
86
|
+
depth: [1.0, 1.1]
|
|
87
|
+
YAML
|
|
88
|
+
|
|
89
|
+
collekt fetch --bbox -6 20 35 45 --start 2023-06-15 \
|
|
90
|
+
--dataset-config datasets.yaml --output-dir data/collections
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Use `--dry-run` to plan provider requests without downloading, and `--strict` to
|
|
94
|
+
fail if any requested source is skipped.
|
|
95
|
+
|
|
96
|
+
### Sources and configuration
|
|
97
|
+
|
|
98
|
+
collekt ships a **curated catalog** of datasets (CMEMS global + Mediterranean,
|
|
99
|
+
ECMWF Open Data, ERA5, Skytruth, Copernicus Data Space, eOdyn). Select concrete
|
|
100
|
+
dataset keys with `DatasetConfig` or its YAML form, and put provider parameters
|
|
101
|
+
such as variable names and depth ranges directly on each selected dataset. See
|
|
102
|
+
[Products](https://ai4copsec.github.io/collekt/products.html) and
|
|
103
|
+
[Credentials](https://ai4copsec.github.io/collekt/credentials.html).
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
just lint # format + lint with ruff
|
|
109
|
+
just test # run the test suite
|
|
110
|
+
just docs # build the Quarto documentation
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The definition of done for any change: `just lint` and `just test` pass, with a
|
|
114
|
+
test for any behavior changed.
|
|
115
|
+
|
|
116
|
+
## Documentation
|
|
117
|
+
|
|
118
|
+
Built with [Quarto](https://quarto.org) and
|
|
119
|
+
[quartodoc](https://machow.github.io/quartodoc/) from `docs/`; the rendered site
|
|
120
|
+
is published to GitHub Pages.
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
[BSD-3-Clause](LICENSE).
|
|
125
|
+
|
|
126
|
+
## Copyright
|
|
127
|
+
|
|
128
|
+
Copyright (c) 2023-2026 [Simula Research Laboratory, Oslo, Norway](https://www.simula.no).
|
|
129
|
+
|
|
130
|
+
## Acknowledgments
|
|
131
|
+
|
|
132
|
+
Part of the EU project [AI4COPSEC](https://ai4copsec.eu), funded by the Horizon
|
|
133
|
+
Europe framework programme under Grant Agreement N. 101190021.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "collekt"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "A library to facilitate spatio-temporal data collection across arbitrary datasources"
|
|
5
|
+
license = "BSD-3-Clause"
|
|
6
|
+
license-files = ["LICENSE"]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
keywords = [
|
|
9
|
+
"data source",
|
|
10
|
+
"collection",
|
|
11
|
+
]
|
|
12
|
+
requires-python = ">=3.13"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
"Programming Language :: Python :: 3.14",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"pydantic",
|
|
22
|
+
"pydantic-settings",
|
|
23
|
+
"pyyaml",
|
|
24
|
+
"requests",
|
|
25
|
+
"shapely",
|
|
26
|
+
"geopy",
|
|
27
|
+
"rich",
|
|
28
|
+
"tqdm",
|
|
29
|
+
"xarray>=2026.4.0",
|
|
30
|
+
"scipy>=1.18.0",
|
|
31
|
+
"cfgrib>=0.9.15.1",
|
|
32
|
+
"eccodeslib>=2.47.3.21",
|
|
33
|
+
"damast",
|
|
34
|
+
"geopandas",
|
|
35
|
+
"polars",
|
|
36
|
+
"copernicusmarine>=2.4.1",
|
|
37
|
+
"cdsapi>=0.7.7",
|
|
38
|
+
"ecmwf-opendata>=0.3.30",
|
|
39
|
+
"hozint-apiclient",
|
|
40
|
+
"python-dotenv>=1.2.2",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[[project.authors]]
|
|
44
|
+
name = "Thomas Roehr"
|
|
45
|
+
email = "roehr@simula.no"
|
|
46
|
+
|
|
47
|
+
[[project.authors]]
|
|
48
|
+
name = "Ola Formo Kihle"
|
|
49
|
+
email = "kihle@simula.no"
|
|
50
|
+
|
|
51
|
+
[[project.authors]]
|
|
52
|
+
name = "Julien Vitay"
|
|
53
|
+
email = "julien.vitay@eodyn.com"
|
|
54
|
+
|
|
55
|
+
[[project.maintainers]]
|
|
56
|
+
name = "Thomas Roehr"
|
|
57
|
+
email = "roehr@simula.no"
|
|
58
|
+
|
|
59
|
+
[project.urls]
|
|
60
|
+
homepage = "https://ai4copsec.github.io/collekt"
|
|
61
|
+
documentation = "https://ai4copsec.github.io/collekt"
|
|
62
|
+
repository = "https://github.com/ai4copsec/collekt"
|
|
63
|
+
|
|
64
|
+
[project.scripts]
|
|
65
|
+
collekt = "collekt.cli.main:run"
|
|
66
|
+
|
|
67
|
+
[build-system]
|
|
68
|
+
requires = ["uv_build>=0.11.2,<0.12.0"]
|
|
69
|
+
build-backend = "uv_build"
|
|
70
|
+
|
|
71
|
+
[tool.ruff]
|
|
72
|
+
target-version = "py313"
|
|
73
|
+
line-length = 120
|
|
74
|
+
|
|
75
|
+
[tool.ruff.format]
|
|
76
|
+
docstring-code-format = true
|
|
77
|
+
|
|
78
|
+
[tool.ruff.lint]
|
|
79
|
+
select = [
|
|
80
|
+
"E",
|
|
81
|
+
"F",
|
|
82
|
+
"W",
|
|
83
|
+
"I",
|
|
84
|
+
"UP",
|
|
85
|
+
"B",
|
|
86
|
+
"SIM",
|
|
87
|
+
]
|
|
88
|
+
ignore = [
|
|
89
|
+
"E501",
|
|
90
|
+
"E741",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
[tool.ruff.lint.per-file-ignores]
|
|
94
|
+
"__init__.py" = ["F401"]
|
|
95
|
+
|
|
96
|
+
[tool.pytest.ini_options]
|
|
97
|
+
testpaths = ["tests"]
|
|
98
|
+
|
|
99
|
+
[tool.commitizen]
|
|
100
|
+
version = "0.2.0"
|
|
101
|
+
name = "cz_conventional_commits"
|
|
102
|
+
version_files = [
|
|
103
|
+
"pyproject.toml:^version = ",
|
|
104
|
+
"src/collekt/version.py:^__version__ = ",
|
|
105
|
+
]
|
|
106
|
+
tag_format = "$version"
|
|
107
|
+
annotated_tag = true
|
|
108
|
+
major_version_zero = true
|
|
109
|
+
update_changelog_on_bump = false
|
|
110
|
+
|
|
111
|
+
[dependency-groups]
|
|
112
|
+
test = [
|
|
113
|
+
"jsonschema>=4.26.0",
|
|
114
|
+
"pytest>=8.0",
|
|
115
|
+
"pytest-cov>=5.0",
|
|
116
|
+
"pytest-timeout>=2.3",
|
|
117
|
+
]
|
|
118
|
+
docs = ["quartodoc>=0.11"]
|
|
119
|
+
dev = [
|
|
120
|
+
"ruff>=0.4",
|
|
121
|
+
"commitizen>=3.0",
|
|
122
|
+
{ include-group = "test" },
|
|
123
|
+
]
|
|
124
|
+
notebook = [
|
|
125
|
+
"ipykernel>=7.3.0",
|
|
126
|
+
"ipywidgets>=8.1.0",
|
|
127
|
+
"jupyterlab>=4.6.0",
|
|
128
|
+
"matplotlib>=3.11.0",
|
|
129
|
+
]
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "collekt"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "A library to facilitate spatio-temporal data collection across arbitrary datasources"
|
|
5
|
+
license = "BSD-3-Clause"
|
|
6
|
+
license-files = ["LICENSE"]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
keywords = ["data source", "collection"]
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Thomas Roehr", email = "roehr@simula.no" },
|
|
11
|
+
{ name = "Ola Formo Kihle", email = "kihle@simula.no" },
|
|
12
|
+
{ name = "Julien Vitay", email = "julien.vitay@eodyn.com" },
|
|
13
|
+
]
|
|
14
|
+
maintainers = [
|
|
15
|
+
{ name = "Thomas Roehr", email = "roehr@simula.no" },
|
|
16
|
+
]
|
|
17
|
+
requires-python = ">=3.13"
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
20
|
+
"Development Status :: 3 - Alpha",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
# collekt installs everything by default: most users want all sources and the
|
|
27
|
+
# gridded Assembler. Provider clients are still imported lazily, so importing
|
|
28
|
+
# collekt stays fast and degrades gracefully if a dependency is removed.
|
|
29
|
+
dependencies = [
|
|
30
|
+
# engine
|
|
31
|
+
"pydantic",
|
|
32
|
+
"pydantic-settings",
|
|
33
|
+
"pyyaml",
|
|
34
|
+
"requests",
|
|
35
|
+
"shapely",
|
|
36
|
+
"geopy",
|
|
37
|
+
"rich",
|
|
38
|
+
"tqdm",
|
|
39
|
+
# gridded assembler + GRIB reading
|
|
40
|
+
"xarray>=2026.4.0",
|
|
41
|
+
"scipy>=1.18.0",
|
|
42
|
+
"cfgrib>=0.9.15.1",
|
|
43
|
+
"eccodeslib>=2.47.3.21",
|
|
44
|
+
# tabular feature backend (Skytruth)
|
|
45
|
+
"damast",
|
|
46
|
+
"geopandas",
|
|
47
|
+
"polars",
|
|
48
|
+
# provider clients
|
|
49
|
+
"copernicusmarine>=2.4.1",
|
|
50
|
+
"cdsapi>=0.7.7",
|
|
51
|
+
"ecmwf-opendata>=0.3.30",
|
|
52
|
+
"hozint-apiclient",
|
|
53
|
+
"python-dotenv>=1.2.2",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[project.urls]
|
|
57
|
+
homepage = "https://ai4copsec.github.io/collekt"
|
|
58
|
+
documentation = "https://ai4copsec.github.io/collekt"
|
|
59
|
+
repository = "https://github.com/ai4copsec/collekt"
|
|
60
|
+
|
|
61
|
+
[project.scripts]
|
|
62
|
+
collekt = "collekt.cli.main:run"
|
|
63
|
+
|
|
64
|
+
[build-system]
|
|
65
|
+
requires = ["uv_build>=0.11.2,<0.12.0"]
|
|
66
|
+
build-backend = "uv_build"
|
|
67
|
+
|
|
68
|
+
[tool.ruff]
|
|
69
|
+
target-version = "py313"
|
|
70
|
+
line-length = 120
|
|
71
|
+
|
|
72
|
+
[tool.ruff.format]
|
|
73
|
+
docstring-code-format = true # also format code blocks inside docstrings
|
|
74
|
+
|
|
75
|
+
[tool.ruff.lint]
|
|
76
|
+
# E/W pycodestyle · F pyflakes · I import sorting · UP pyupgrade
|
|
77
|
+
# · B bugbear (likely bugs) · SIM simplify
|
|
78
|
+
select = ["E", "F", "W", "I", "UP", "B", "SIM"]
|
|
79
|
+
ignore = [
|
|
80
|
+
"E501", # line length: the formatter already wraps code; don't double-flag long strings/URLs
|
|
81
|
+
"E741", # allow short math-style names (l, I, O), common in research code
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[tool.ruff.lint.per-file-ignores]
|
|
85
|
+
"__init__.py" = ["F401"] # imports in a package __init__ are re-exports, not dead code
|
|
86
|
+
|
|
87
|
+
[tool.pytest.ini_options]
|
|
88
|
+
testpaths = ["tests"]
|
|
89
|
+
|
|
90
|
+
[tool.commitizen]
|
|
91
|
+
version = "0.2.0"
|
|
92
|
+
name = "cz_conventional_commits"
|
|
93
|
+
version_files = [
|
|
94
|
+
"pyproject.toml:^version = ",
|
|
95
|
+
"src/collekt/version.py:^__version__ = ",
|
|
96
|
+
]
|
|
97
|
+
tag_format = "$version"
|
|
98
|
+
annotated_tag = true
|
|
99
|
+
major_version_zero = true
|
|
100
|
+
update_changelog_on_bump = false
|
|
101
|
+
|
|
102
|
+
# Dev-only tooling. uv installs the `dev` group automatically on `uv sync`
|
|
103
|
+
# and `uv run`, so `just test` / `just lint` work without extra flags.
|
|
104
|
+
[dependency-groups]
|
|
105
|
+
test = [
|
|
106
|
+
"jsonschema>=4.26.0",
|
|
107
|
+
"pytest>=8.0",
|
|
108
|
+
"pytest-cov>=5.0",
|
|
109
|
+
"pytest-timeout>=2.3",
|
|
110
|
+
]
|
|
111
|
+
docs = ["quartodoc>=0.11"]
|
|
112
|
+
dev = [
|
|
113
|
+
"ruff>=0.4",
|
|
114
|
+
"commitizen>=3.0",
|
|
115
|
+
{ include-group = "test" },
|
|
116
|
+
]
|
|
117
|
+
notebook = [
|
|
118
|
+
"ipykernel>=7.3.0",
|
|
119
|
+
"ipywidgets>=8.1.0",
|
|
120
|
+
"jupyterlab>=4.6.0",
|
|
121
|
+
"matplotlib>=3.11.0",
|
|
122
|
+
]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""collekt: a library to facilitate spatio-temporal data collection.
|
|
2
|
+
|
|
3
|
+
Public API.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from dotenv import find_dotenv, load_dotenv
|
|
7
|
+
|
|
8
|
+
# Importing the sources package registers the built-in source adapters.
|
|
9
|
+
from collekt import sources # noqa: F401
|
|
10
|
+
from collekt.assemble import Assembler
|
|
11
|
+
from collekt.core.catalog import available_datasets, describe_datasets
|
|
12
|
+
from collekt.core.datasets import (
|
|
13
|
+
CMEMS,
|
|
14
|
+
ERA5,
|
|
15
|
+
CopernicusDataSpace,
|
|
16
|
+
DatasetConfig,
|
|
17
|
+
ECMWFOpenData,
|
|
18
|
+
Hozint,
|
|
19
|
+
SkyTruth,
|
|
20
|
+
eOdyn,
|
|
21
|
+
)
|
|
22
|
+
from collekt.core.doctor import DoctorCheck, run_doctor
|
|
23
|
+
from collekt.core.fetcher import Fetcher
|
|
24
|
+
from collekt.core.request import Region, Request
|
|
25
|
+
from collekt.core.result import Result
|
|
26
|
+
|
|
27
|
+
from .version import __version__, __version_info__
|
|
28
|
+
|
|
29
|
+
# Load a project-local .env (searched upward from the working directory) so
|
|
30
|
+
# credentials placed there reach every provider adapter: the provider tools read
|
|
31
|
+
# the OS environment, which this fills. Existing environment variables win.
|
|
32
|
+
load_dotenv(find_dotenv(usecwd=True))
|
|
33
|
+
|
|
34
|
+
__all__ = [
|
|
35
|
+
"Assembler",
|
|
36
|
+
"CMEMS",
|
|
37
|
+
"CopernicusDataSpace",
|
|
38
|
+
"DatasetConfig",
|
|
39
|
+
"DoctorCheck",
|
|
40
|
+
"ECMWFOpenData",
|
|
41
|
+
"ERA5",
|
|
42
|
+
"Fetcher",
|
|
43
|
+
"Hozint",
|
|
44
|
+
"Region",
|
|
45
|
+
"Request",
|
|
46
|
+
"Result",
|
|
47
|
+
"SkyTruth",
|
|
48
|
+
"available_datasets",
|
|
49
|
+
"describe_datasets",
|
|
50
|
+
"eOdyn",
|
|
51
|
+
"run_doctor",
|
|
52
|
+
"__version__",
|
|
53
|
+
"__version_info__",
|
|
54
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Analysis-ready assembly of downloaded collections.
|
|
2
|
+
|
|
3
|
+
`Assembler` builds gridded outputs (xarray / NetCDF / Zarr / NumPy) from a
|
|
4
|
+
`collekt.Result`. Feature (tabular) sources are written directly by their
|
|
5
|
+
adapters and are not assembled here.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from collekt.assemble.gridded import Assembler
|
|
9
|
+
|
|
10
|
+
__all__ = ["Assembler"]
|