A CLI tool for fetching data from open data sources, to be extended to forecast as well. Currently, only the fetching data from CDS and ECPDS is implemented.
You can install using pip and github directly:
pip install git+https://github.com/dsih-artpark/indra
This will install from the default branch, i.e. production
.
pip install --upgrade git+https://github.com/dsih-artpark/indra
The application requires two configuration files:
- Environment variables file (copy and modify
example.env
):
cp example.env .env
- A YAML file for application settings (copy and modify
example.yaml
):
cp example.yaml config.yaml
- Create an account on the Climate Data Store
- Accept the Terms of Use
- Create a
.cdsapirc
file in your home directory with your API key:
url: https://cds.climate.copernicus.eu/api/v2
key: YOUR-API-KEY
# Fetch CDS data for current month
indra fetch cds config.yaml
# Fetch CDS data with custom date range (specified in yaml)
indra fetch cds config.yaml --custom-date
# Enable debug mode
indra fetch cds config.yaml --debug
# Set custom log level and file
indra --log-level DEBUG --log-file "custom.log" fetch cds config.yaml
--log-level, -l
: Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)--log-file, -f
: Specify custom log file
--current-month/--custom-date, -c/-C
: Use current month or dates from config--debug/--no-debug, -d/-D
: Enable/disable debug mode
The YAML configuration file contains settings for:
shared_params:
local_data_dir: "~/.dsih-data/"
email_recipients:
"user@example.com": "User Name"
s3_bucket: 'example-bucket-name'
cds:
# CDS-specific configuration
cds_dataset_name: "reanalysis-era5-single-levels"
bounds_nwse:
ka: [19,74,11,79] # Example bounds
variables:
"2m_temperature": "2t"
# ... other variables
ecpds:
# ECPDS-specific configuration
url: 'https://data.ecmwf.int/forecasts'
# ... other settings
Required environment variables in .env
:
# CDS API Credentials
CDS_URL=https://cds.climate.copernicus.eu/api/v2
CDS_KEY=YOUR_CDS_API_KEY
# AWS S3 Credentials
AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_KEY
AWS_DEFAULT_REGION=ap-south-1
# Email Configuration
SMTP_SERVER=smtp.gmail.com
PORT=587
EMAIL=your.email@gmail.com
PASSWORD=your_app_specific_password
- Fetch ERA5 reanalysis data from CDS
- Download ECMWF operational forecasts
- Automatic S3 upload of downloaded data
- Email notifications for job status
- Configurable logging
- Support for multiple regions and variables
- Automatic file cleanup after S3 upload
- Python 3.11+
- AWS credentials ( if using S3. You can use the api and store files in your own server and skip the s3 set up)
- CDS API access
Poetry is required for development.
- Install development dependencies:
poetry install --with dev
- Install documentation dependencies:
poetry install --with docs
Build the documentation:
cd docs
make html
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
- Sai Sneha sneha@artpark.in
- Aishwarya R aishwarya@artpark.in
- Akhil Babu akhil@artpark.in
- Swarna AN swarna@artpark.in