Metadata-Version: 2.4
Name: npdc-era5
Version: 1.0.0
Summary: Interactive CLI to discover, download, and quality-check ERA5 reanalysis data from the Copernicus Climate Data Store.
Author: NCPOR / National Polar Data Center
License-Expression: MIT
Project-URL: Homepage, https://github.com/ncpor/era5-cli
Project-URL: Issues, https://github.com/ncpor/era5-cli/issues
Keywords: era5,climate,reanalysis,copernicus,cds,weather,netcdf
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cdsapi>=0.7
Requires-Dist: xarray>=2023.1
Requires-Dist: netcdf4>=1.6
Requires-Dist: numpy>=1.24
Requires-Dist: requests>=2.28
Dynamic: license-file

# ERA5 CLI

Interactive command-line tool to discover, download, and quality-check ERA5 reanalysis data from the [Copernicus Climate Data Store](https://cds.climate.copernicus.eu).

Developed at the **National Polar Data Center (NPDC)**, National Centre for Polar and Ocean Research (NCPOR), Ministry of Earth Sciences, Government of India.

## Installation

```bash
pip install era5-cli
```

## Prerequisites

Register at [cds.climate.copernicus.eu](https://cds.climate.copernicus.eu) and create `~/.cdsapirc`:

```
url: https://cds.climate.copernicus.eu/api
key: YOUR_UID:YOUR_API_KEY
```

## Usage

```bash
era5
```

The tool will interactively walk you through:

1. **Dataset selection** — dynamically fetched from the CDS catalogue (8 core ERA5 datasets)
2. **Variable selection** — full list pulled live from the API (e.g., 262 variables for single-levels)
3. **Spatial coverage** — global or custom bounding box
4. **Temporal range** — start/end dates
5. **Time of day** — noon, all 24 hours, or custom
6. **Output** — choose directory and filename

After download, automatic **quality control** checks for:
- Missing data (NaN values)
- Physical bounds (temperature, pressure, wind speed)

### Features

- **Dynamic discovery** — datasets and variables are fetched live from the CDS API
- **7-day local cache** — subsequent launches are instant (`~/.era5_cli_cache.json`)
- **Hardcoded fallback** — works offline with a built-in variable list + warning
- **Search & range selection** — type `search wind` or `1-5,10,15` when picking variables
- **Quality control** — automatic physical-bounds checking on downloaded NetCDF files
- **File summary** — prints min/max per variable after download

## Available Datasets

| Dataset | Variables |
|---------|-----------|
| ERA5-Land hourly | 60 |
| ERA5-Land monthly means | 60 |
| ERA5-Land hourly time-series | 19 |
| ERA5 pressure levels hourly | 16 |
| ERA5 pressure levels monthly means | 16 |
| ERA5 single levels hourly | 262 |
| ERA5 single levels monthly means | 260 |
| ERA5 single levels hourly time-series | 21 |

## License

MIT — see [LICENSE](LICENSE).
