spatioClimata 0.1.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.
- spatioclimata-0.1.0/LICENSE +21 -0
- spatioclimata-0.1.0/PKG-INFO +173 -0
- spatioclimata-0.1.0/README.md +133 -0
- spatioclimata-0.1.0/pyproject.toml +74 -0
- spatioclimata-0.1.0/setup.cfg +4 -0
- spatioclimata-0.1.0/src/spatioClimata.egg-info/PKG-INFO +173 -0
- spatioclimata-0.1.0/src/spatioClimata.egg-info/SOURCES.txt +26 -0
- spatioclimata-0.1.0/src/spatioClimata.egg-info/dependency_links.txt +1 -0
- spatioclimata-0.1.0/src/spatioClimata.egg-info/entry_points.txt +2 -0
- spatioclimata-0.1.0/src/spatioClimata.egg-info/requires.txt +18 -0
- spatioclimata-0.1.0/src/spatioClimata.egg-info/top_level.txt +1 -0
- spatioclimata-0.1.0/src/spatioclimata/__init__.py +18 -0
- spatioclimata-0.1.0/src/spatioclimata/__main__.py +4 -0
- spatioclimata-0.1.0/src/spatioclimata/api.py +64 -0
- spatioclimata-0.1.0/src/spatioclimata/auth.py +134 -0
- spatioclimata-0.1.0/src/spatioclimata/catalog.py +138 -0
- spatioclimata-0.1.0/src/spatioclimata/cli.py +173 -0
- spatioclimata-0.1.0/src/spatioclimata/exceptions.py +25 -0
- spatioclimata-0.1.0/src/spatioclimata/io.py +99 -0
- spatioclimata-0.1.0/src/spatioclimata/models.py +139 -0
- spatioclimata-0.1.0/src/spatioclimata/pipeline.py +205 -0
- spatioclimata-0.1.0/src/spatioclimata/request_builder.py +53 -0
- spatioclimata-0.1.0/src/spatioclimata/transforms.py +81 -0
- spatioclimata-0.1.0/src/spatioclimata/validation.py +65 -0
- spatioclimata-0.1.0/tests/test_models.py +21 -0
- spatioclimata-0.1.0/tests/test_request_builder.py +30 -0
- spatioclimata-0.1.0/tests/test_transforms.py +31 -0
- spatioclimata-0.1.0/tests/test_validation.py +30 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nethum Perera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spatioClimata
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Copernicus climate and hydrology data pipeline toolkit with analytics-ready outputs.
|
|
5
|
+
Author-email: Nethum Perera <nethumsemithaperera@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nethumperera/spatioClimata
|
|
8
|
+
Project-URL: Repository, https://github.com/nethumperera/spatioClimata
|
|
9
|
+
Project-URL: Issues, https://github.com/nethumperera/spatioClimata/issues
|
|
10
|
+
Keywords: copernicus,era5,glofas,climate,hydrology,geospatial,xarray,pipeline
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: cdsapi>=0.7.3
|
|
24
|
+
Requires-Dist: xarray>=2024.1.0
|
|
25
|
+
Requires-Dist: numpy>=1.25.0
|
|
26
|
+
Requires-Dist: netcdf4>=1.6.0
|
|
27
|
+
Requires-Dist: h5netcdf>=1.3.0
|
|
28
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
29
|
+
Requires-Dist: typer>=0.12.3
|
|
30
|
+
Requires-Dist: pydantic>=2.6.0
|
|
31
|
+
Provides-Extra: dask
|
|
32
|
+
Requires-Dist: dask[distributed]>=2024.4.1; extra == "dask"
|
|
33
|
+
Requires-Dist: fsspec>=2024.3.1; extra == "dask"
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: ruff>=0.4.0; extra == "dev"
|
|
38
|
+
Requires-Dist: mypy>=1.9.0; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# spatioClimata
|
|
42
|
+
|
|
43
|
+
spatioClimata is a Python package for requesting, validating, downloading, and transforming Copernicus climate and hydrology datasets into analytics-ready outputs.
|
|
44
|
+
|
|
45
|
+
It is designed for ERA5, GloFAS, and extensible CDS/EWDS datasets, with an opinionated data engineering pipeline and optional Dask acceleration.
|
|
46
|
+
|
|
47
|
+
## Why spatioClimata
|
|
48
|
+
|
|
49
|
+
- Unified access to CDS and EWDS with one API key workflow.
|
|
50
|
+
- Dataset capability checks before large downloads.
|
|
51
|
+
- Hourly and daily workflows with optional frequency conversion.
|
|
52
|
+
- Resumable, idempotent download pipeline for long-running jobs.
|
|
53
|
+
- Analytics-ready outputs as xarray Dataset with NetCDF/Zarr export.
|
|
54
|
+
- Optional Dask integration for chunked processing at scale.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install spatioClimata
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For Dask-enabled workflows:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install "spatioClimata[dask]"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For development:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install "spatioClimata[dev,dask]"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Quick Start
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from spatioclimata import (
|
|
78
|
+
AreaBBox,
|
|
79
|
+
TimeRange,
|
|
80
|
+
FetchRequest,
|
|
81
|
+
fetch,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
request = FetchRequest(
|
|
85
|
+
dataset="derived-era5-single-levels-daily-statistics",
|
|
86
|
+
variables=["total_precipitation", "2m_temperature"],
|
|
87
|
+
time_range=TimeRange.from_strings("2020-01-01", "2020-12-31"),
|
|
88
|
+
area=AreaBBox.from_sequence([6.22, 80.41, 5.91, 80.64]),
|
|
89
|
+
frequency="daily",
|
|
90
|
+
output_dir="./outputs",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
result = fetch(request, open_browser_on_missing_key=True)
|
|
94
|
+
print(result.saved_files)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## CLI Usage
|
|
98
|
+
|
|
99
|
+
Initialize credentials:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
spatioclimata auth init --open-browser
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
List datasets:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
spatioclimata datasets list
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Run a download:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
spatioclimata fetch \
|
|
115
|
+
--dataset derived-era5-single-levels-daily-statistics \
|
|
116
|
+
--variables total_precipitation,2m_temperature \
|
|
117
|
+
--start 2020-01-01 \
|
|
118
|
+
--end 2020-12-31 \
|
|
119
|
+
--area 6.22,80.41,5.91,80.64 \
|
|
120
|
+
--frequency daily \
|
|
121
|
+
--output-dir ./outputs
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Account and API Key Onboarding
|
|
125
|
+
|
|
126
|
+
The package needs a Copernicus API key.
|
|
127
|
+
|
|
128
|
+
- `spatioclimata auth init --open-browser` opens signup and API key pages.
|
|
129
|
+
- Credentials are saved to a local config file with restricted permissions when possible.
|
|
130
|
+
- Environment variables are also supported:
|
|
131
|
+
- `SPATIOCLIMATA_API_KEY`
|
|
132
|
+
- `ERA5_Key`
|
|
133
|
+
|
|
134
|
+
## Project Layout
|
|
135
|
+
|
|
136
|
+
- `src/spatioclimata/`: package source
|
|
137
|
+
- `tests/`: unit tests
|
|
138
|
+
- `examples/`: runnable usage examples
|
|
139
|
+
- `docs/`: architecture and usage guides
|
|
140
|
+
- `.github/workflows/`: CI
|
|
141
|
+
- `website/`: static project website (GitHub Pages source)
|
|
142
|
+
- `scripts/`: helper scripts for repo bootstrap, website sync, and releases
|
|
143
|
+
|
|
144
|
+
## Documentation Index
|
|
145
|
+
|
|
146
|
+
- [Quickstart](docs/quickstart.md)
|
|
147
|
+
- [Architecture](docs/architecture.md)
|
|
148
|
+
- [Pipeline Guide](docs/pipeline.md)
|
|
149
|
+
- [Dataset Support](docs/dataset-support.md)
|
|
150
|
+
- [Release and Deploy](docs/release-deploy.md)
|
|
151
|
+
|
|
152
|
+
## Status
|
|
153
|
+
|
|
154
|
+
Current release is an MVP foundation intended to be expanded with additional dataset adapters and transformations.
|
|
155
|
+
|
|
156
|
+
## Release and Deployment
|
|
157
|
+
|
|
158
|
+
### PyPI Publish
|
|
159
|
+
|
|
160
|
+
- Workflow: `.github/workflows/publish-pypi.yml`
|
|
161
|
+
- Trigger: push a version tag (example: `v0.1.0`)
|
|
162
|
+
- Recommended: configure PyPI Trusted Publishing for this repository
|
|
163
|
+
|
|
164
|
+
### Website Deploy
|
|
165
|
+
|
|
166
|
+
- Workflow: `.github/workflows/deploy-pages.yml`
|
|
167
|
+
- Source folder: `website/`
|
|
168
|
+
- Trigger: push to `main` when website files change
|
|
169
|
+
- GitHub setting required: enable GitHub Pages with "GitHub Actions" as source
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
MIT
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# spatioClimata
|
|
2
|
+
|
|
3
|
+
spatioClimata is a Python package for requesting, validating, downloading, and transforming Copernicus climate and hydrology datasets into analytics-ready outputs.
|
|
4
|
+
|
|
5
|
+
It is designed for ERA5, GloFAS, and extensible CDS/EWDS datasets, with an opinionated data engineering pipeline and optional Dask acceleration.
|
|
6
|
+
|
|
7
|
+
## Why spatioClimata
|
|
8
|
+
|
|
9
|
+
- Unified access to CDS and EWDS with one API key workflow.
|
|
10
|
+
- Dataset capability checks before large downloads.
|
|
11
|
+
- Hourly and daily workflows with optional frequency conversion.
|
|
12
|
+
- Resumable, idempotent download pipeline for long-running jobs.
|
|
13
|
+
- Analytics-ready outputs as xarray Dataset with NetCDF/Zarr export.
|
|
14
|
+
- Optional Dask integration for chunked processing at scale.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install spatioClimata
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For Dask-enabled workflows:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install "spatioClimata[dask]"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For development:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install "spatioClimata[dev,dask]"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from spatioclimata import (
|
|
38
|
+
AreaBBox,
|
|
39
|
+
TimeRange,
|
|
40
|
+
FetchRequest,
|
|
41
|
+
fetch,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
request = FetchRequest(
|
|
45
|
+
dataset="derived-era5-single-levels-daily-statistics",
|
|
46
|
+
variables=["total_precipitation", "2m_temperature"],
|
|
47
|
+
time_range=TimeRange.from_strings("2020-01-01", "2020-12-31"),
|
|
48
|
+
area=AreaBBox.from_sequence([6.22, 80.41, 5.91, 80.64]),
|
|
49
|
+
frequency="daily",
|
|
50
|
+
output_dir="./outputs",
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
result = fetch(request, open_browser_on_missing_key=True)
|
|
54
|
+
print(result.saved_files)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## CLI Usage
|
|
58
|
+
|
|
59
|
+
Initialize credentials:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
spatioclimata auth init --open-browser
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
List datasets:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
spatioclimata datasets list
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Run a download:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
spatioclimata fetch \
|
|
75
|
+
--dataset derived-era5-single-levels-daily-statistics \
|
|
76
|
+
--variables total_precipitation,2m_temperature \
|
|
77
|
+
--start 2020-01-01 \
|
|
78
|
+
--end 2020-12-31 \
|
|
79
|
+
--area 6.22,80.41,5.91,80.64 \
|
|
80
|
+
--frequency daily \
|
|
81
|
+
--output-dir ./outputs
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Account and API Key Onboarding
|
|
85
|
+
|
|
86
|
+
The package needs a Copernicus API key.
|
|
87
|
+
|
|
88
|
+
- `spatioclimata auth init --open-browser` opens signup and API key pages.
|
|
89
|
+
- Credentials are saved to a local config file with restricted permissions when possible.
|
|
90
|
+
- Environment variables are also supported:
|
|
91
|
+
- `SPATIOCLIMATA_API_KEY`
|
|
92
|
+
- `ERA5_Key`
|
|
93
|
+
|
|
94
|
+
## Project Layout
|
|
95
|
+
|
|
96
|
+
- `src/spatioclimata/`: package source
|
|
97
|
+
- `tests/`: unit tests
|
|
98
|
+
- `examples/`: runnable usage examples
|
|
99
|
+
- `docs/`: architecture and usage guides
|
|
100
|
+
- `.github/workflows/`: CI
|
|
101
|
+
- `website/`: static project website (GitHub Pages source)
|
|
102
|
+
- `scripts/`: helper scripts for repo bootstrap, website sync, and releases
|
|
103
|
+
|
|
104
|
+
## Documentation Index
|
|
105
|
+
|
|
106
|
+
- [Quickstart](docs/quickstart.md)
|
|
107
|
+
- [Architecture](docs/architecture.md)
|
|
108
|
+
- [Pipeline Guide](docs/pipeline.md)
|
|
109
|
+
- [Dataset Support](docs/dataset-support.md)
|
|
110
|
+
- [Release and Deploy](docs/release-deploy.md)
|
|
111
|
+
|
|
112
|
+
## Status
|
|
113
|
+
|
|
114
|
+
Current release is an MVP foundation intended to be expanded with additional dataset adapters and transformations.
|
|
115
|
+
|
|
116
|
+
## Release and Deployment
|
|
117
|
+
|
|
118
|
+
### PyPI Publish
|
|
119
|
+
|
|
120
|
+
- Workflow: `.github/workflows/publish-pypi.yml`
|
|
121
|
+
- Trigger: push a version tag (example: `v0.1.0`)
|
|
122
|
+
- Recommended: configure PyPI Trusted Publishing for this repository
|
|
123
|
+
|
|
124
|
+
### Website Deploy
|
|
125
|
+
|
|
126
|
+
- Workflow: `.github/workflows/deploy-pages.yml`
|
|
127
|
+
- Source folder: `website/`
|
|
128
|
+
- Trigger: push to `main` when website files change
|
|
129
|
+
- GitHub setting required: enable GitHub Pages with "GitHub Actions" as source
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "spatioClimata"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Copernicus climate and hydrology data pipeline toolkit with analytics-ready outputs."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [
|
|
11
|
+
{ name = "Nethum Perera", email = "nethumsemithaperera@gmail.com" }
|
|
12
|
+
]
|
|
13
|
+
license = { text = "MIT" }
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
keywords = ["copernicus", "era5", "glofas", "climate", "hydrology", "geospatial", "xarray", "pipeline"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Atmospheric Science",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Hydrology",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"cdsapi>=0.7.3",
|
|
29
|
+
"xarray>=2024.1.0",
|
|
30
|
+
"numpy>=1.25.0",
|
|
31
|
+
"netcdf4>=1.6.0",
|
|
32
|
+
"h5netcdf>=1.3.0",
|
|
33
|
+
"python-dotenv>=1.0.1",
|
|
34
|
+
"typer>=0.12.3",
|
|
35
|
+
"pydantic>=2.6.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
dask = [
|
|
40
|
+
"dask[distributed]>=2024.4.1",
|
|
41
|
+
"fsspec>=2024.3.1",
|
|
42
|
+
]
|
|
43
|
+
dev = [
|
|
44
|
+
"pytest>=8.0.0",
|
|
45
|
+
"pytest-cov>=5.0.0",
|
|
46
|
+
"ruff>=0.4.0",
|
|
47
|
+
"mypy>=1.9.0",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Homepage = "https://github.com/nethumperera/spatioClimata"
|
|
52
|
+
Repository = "https://github.com/nethumperera/spatioClimata"
|
|
53
|
+
Issues = "https://github.com/nethumperera/spatioClimata/issues"
|
|
54
|
+
|
|
55
|
+
[project.scripts]
|
|
56
|
+
spatioclimata = "spatioclimata.cli:app"
|
|
57
|
+
|
|
58
|
+
[tool.setuptools]
|
|
59
|
+
package-dir = {"" = "src"}
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.packages.find]
|
|
62
|
+
where = ["src"]
|
|
63
|
+
|
|
64
|
+
[tool.pytest.ini_options]
|
|
65
|
+
testpaths = ["tests"]
|
|
66
|
+
addopts = "-q"
|
|
67
|
+
|
|
68
|
+
[tool.ruff]
|
|
69
|
+
line-length = 100
|
|
70
|
+
target-version = "py310"
|
|
71
|
+
|
|
72
|
+
[tool.ruff.lint]
|
|
73
|
+
select = ["E", "F", "I", "B", "UP"]
|
|
74
|
+
ignore = ["E501"]
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spatioClimata
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Copernicus climate and hydrology data pipeline toolkit with analytics-ready outputs.
|
|
5
|
+
Author-email: Nethum Perera <nethumsemithaperera@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nethumperera/spatioClimata
|
|
8
|
+
Project-URL: Repository, https://github.com/nethumperera/spatioClimata
|
|
9
|
+
Project-URL: Issues, https://github.com/nethumperera/spatioClimata/issues
|
|
10
|
+
Keywords: copernicus,era5,glofas,climate,hydrology,geospatial,xarray,pipeline
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: cdsapi>=0.7.3
|
|
24
|
+
Requires-Dist: xarray>=2024.1.0
|
|
25
|
+
Requires-Dist: numpy>=1.25.0
|
|
26
|
+
Requires-Dist: netcdf4>=1.6.0
|
|
27
|
+
Requires-Dist: h5netcdf>=1.3.0
|
|
28
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
29
|
+
Requires-Dist: typer>=0.12.3
|
|
30
|
+
Requires-Dist: pydantic>=2.6.0
|
|
31
|
+
Provides-Extra: dask
|
|
32
|
+
Requires-Dist: dask[distributed]>=2024.4.1; extra == "dask"
|
|
33
|
+
Requires-Dist: fsspec>=2024.3.1; extra == "dask"
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: ruff>=0.4.0; extra == "dev"
|
|
38
|
+
Requires-Dist: mypy>=1.9.0; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# spatioClimata
|
|
42
|
+
|
|
43
|
+
spatioClimata is a Python package for requesting, validating, downloading, and transforming Copernicus climate and hydrology datasets into analytics-ready outputs.
|
|
44
|
+
|
|
45
|
+
It is designed for ERA5, GloFAS, and extensible CDS/EWDS datasets, with an opinionated data engineering pipeline and optional Dask acceleration.
|
|
46
|
+
|
|
47
|
+
## Why spatioClimata
|
|
48
|
+
|
|
49
|
+
- Unified access to CDS and EWDS with one API key workflow.
|
|
50
|
+
- Dataset capability checks before large downloads.
|
|
51
|
+
- Hourly and daily workflows with optional frequency conversion.
|
|
52
|
+
- Resumable, idempotent download pipeline for long-running jobs.
|
|
53
|
+
- Analytics-ready outputs as xarray Dataset with NetCDF/Zarr export.
|
|
54
|
+
- Optional Dask integration for chunked processing at scale.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install spatioClimata
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For Dask-enabled workflows:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install "spatioClimata[dask]"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For development:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install "spatioClimata[dev,dask]"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Quick Start
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from spatioclimata import (
|
|
78
|
+
AreaBBox,
|
|
79
|
+
TimeRange,
|
|
80
|
+
FetchRequest,
|
|
81
|
+
fetch,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
request = FetchRequest(
|
|
85
|
+
dataset="derived-era5-single-levels-daily-statistics",
|
|
86
|
+
variables=["total_precipitation", "2m_temperature"],
|
|
87
|
+
time_range=TimeRange.from_strings("2020-01-01", "2020-12-31"),
|
|
88
|
+
area=AreaBBox.from_sequence([6.22, 80.41, 5.91, 80.64]),
|
|
89
|
+
frequency="daily",
|
|
90
|
+
output_dir="./outputs",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
result = fetch(request, open_browser_on_missing_key=True)
|
|
94
|
+
print(result.saved_files)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## CLI Usage
|
|
98
|
+
|
|
99
|
+
Initialize credentials:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
spatioclimata auth init --open-browser
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
List datasets:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
spatioclimata datasets list
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Run a download:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
spatioclimata fetch \
|
|
115
|
+
--dataset derived-era5-single-levels-daily-statistics \
|
|
116
|
+
--variables total_precipitation,2m_temperature \
|
|
117
|
+
--start 2020-01-01 \
|
|
118
|
+
--end 2020-12-31 \
|
|
119
|
+
--area 6.22,80.41,5.91,80.64 \
|
|
120
|
+
--frequency daily \
|
|
121
|
+
--output-dir ./outputs
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Account and API Key Onboarding
|
|
125
|
+
|
|
126
|
+
The package needs a Copernicus API key.
|
|
127
|
+
|
|
128
|
+
- `spatioclimata auth init --open-browser` opens signup and API key pages.
|
|
129
|
+
- Credentials are saved to a local config file with restricted permissions when possible.
|
|
130
|
+
- Environment variables are also supported:
|
|
131
|
+
- `SPATIOCLIMATA_API_KEY`
|
|
132
|
+
- `ERA5_Key`
|
|
133
|
+
|
|
134
|
+
## Project Layout
|
|
135
|
+
|
|
136
|
+
- `src/spatioclimata/`: package source
|
|
137
|
+
- `tests/`: unit tests
|
|
138
|
+
- `examples/`: runnable usage examples
|
|
139
|
+
- `docs/`: architecture and usage guides
|
|
140
|
+
- `.github/workflows/`: CI
|
|
141
|
+
- `website/`: static project website (GitHub Pages source)
|
|
142
|
+
- `scripts/`: helper scripts for repo bootstrap, website sync, and releases
|
|
143
|
+
|
|
144
|
+
## Documentation Index
|
|
145
|
+
|
|
146
|
+
- [Quickstart](docs/quickstart.md)
|
|
147
|
+
- [Architecture](docs/architecture.md)
|
|
148
|
+
- [Pipeline Guide](docs/pipeline.md)
|
|
149
|
+
- [Dataset Support](docs/dataset-support.md)
|
|
150
|
+
- [Release and Deploy](docs/release-deploy.md)
|
|
151
|
+
|
|
152
|
+
## Status
|
|
153
|
+
|
|
154
|
+
Current release is an MVP foundation intended to be expanded with additional dataset adapters and transformations.
|
|
155
|
+
|
|
156
|
+
## Release and Deployment
|
|
157
|
+
|
|
158
|
+
### PyPI Publish
|
|
159
|
+
|
|
160
|
+
- Workflow: `.github/workflows/publish-pypi.yml`
|
|
161
|
+
- Trigger: push a version tag (example: `v0.1.0`)
|
|
162
|
+
- Recommended: configure PyPI Trusted Publishing for this repository
|
|
163
|
+
|
|
164
|
+
### Website Deploy
|
|
165
|
+
|
|
166
|
+
- Workflow: `.github/workflows/deploy-pages.yml`
|
|
167
|
+
- Source folder: `website/`
|
|
168
|
+
- Trigger: push to `main` when website files change
|
|
169
|
+
- GitHub setting required: enable GitHub Pages with "GitHub Actions" as source
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
MIT
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/spatioClimata.egg-info/PKG-INFO
|
|
5
|
+
src/spatioClimata.egg-info/SOURCES.txt
|
|
6
|
+
src/spatioClimata.egg-info/dependency_links.txt
|
|
7
|
+
src/spatioClimata.egg-info/entry_points.txt
|
|
8
|
+
src/spatioClimata.egg-info/requires.txt
|
|
9
|
+
src/spatioClimata.egg-info/top_level.txt
|
|
10
|
+
src/spatioclimata/__init__.py
|
|
11
|
+
src/spatioclimata/__main__.py
|
|
12
|
+
src/spatioclimata/api.py
|
|
13
|
+
src/spatioclimata/auth.py
|
|
14
|
+
src/spatioclimata/catalog.py
|
|
15
|
+
src/spatioclimata/cli.py
|
|
16
|
+
src/spatioclimata/exceptions.py
|
|
17
|
+
src/spatioclimata/io.py
|
|
18
|
+
src/spatioclimata/models.py
|
|
19
|
+
src/spatioclimata/pipeline.py
|
|
20
|
+
src/spatioclimata/request_builder.py
|
|
21
|
+
src/spatioclimata/transforms.py
|
|
22
|
+
src/spatioclimata/validation.py
|
|
23
|
+
tests/test_models.py
|
|
24
|
+
tests/test_request_builder.py
|
|
25
|
+
tests/test_transforms.py
|
|
26
|
+
tests/test_validation.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
cdsapi>=0.7.3
|
|
2
|
+
xarray>=2024.1.0
|
|
3
|
+
numpy>=1.25.0
|
|
4
|
+
netcdf4>=1.6.0
|
|
5
|
+
h5netcdf>=1.3.0
|
|
6
|
+
python-dotenv>=1.0.1
|
|
7
|
+
typer>=0.12.3
|
|
8
|
+
pydantic>=2.6.0
|
|
9
|
+
|
|
10
|
+
[dask]
|
|
11
|
+
dask[distributed]>=2024.4.1
|
|
12
|
+
fsspec>=2024.3.1
|
|
13
|
+
|
|
14
|
+
[dev]
|
|
15
|
+
pytest>=8.0.0
|
|
16
|
+
pytest-cov>=5.0.0
|
|
17
|
+
ruff>=0.4.0
|
|
18
|
+
mypy>=1.9.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
spatioclimata
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""spatioClimata public API."""
|
|
2
|
+
|
|
3
|
+
from .api import fetch, init_auth, list_datasets, list_frequencies, list_variables
|
|
4
|
+
from .models import AreaBBox, FetchRequest, FetchResult, TimeRange
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"AreaBBox",
|
|
8
|
+
"TimeRange",
|
|
9
|
+
"FetchRequest",
|
|
10
|
+
"FetchResult",
|
|
11
|
+
"list_datasets",
|
|
12
|
+
"list_variables",
|
|
13
|
+
"list_frequencies",
|
|
14
|
+
"init_auth",
|
|
15
|
+
"fetch",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
__version__ = "0.1.0"
|