Download, extract, average, plot, and analyze NASA GPM IMERG precipitation data from Python or a local web UI.
Project description
imergpy
imergpy is a Python package and local web interface for downloading NASA GPM IMERG precipitation data through NASA Earthdata/GES DISC. It can extract point rainfall time series and compute grid-cell average rainfall for selected countries or square areas.
Quick Start
Install and open:
pip install imergpy
imergpy
Your browser should open automatically. Enter your NASA Earthdata username/password in the local page and choose a point, country, or square area.
Features
- Local web UI launched with the
imergpycommand - Python API for scripted workflows
- Point, country, and square-area selection in the web map
- Grid-cell average precipitation for country and square-area selections
- Half-hourly, daily, and monthly IMERG products
- Early, Late, and Final IMERG run types where available
- Excel export with separate
Start TimeandEnd Timecolumns - Basic rainfall plotting and statistics utilities
Web UI
imergpy
If the command is not available on Windows:
python -m imergpy.cli
If port 5000 is busy:
$env:IMERGPY_PORT = "5001"
python -m imergpy.cli
Python API Example
import os
import imergpy
excel_path, records = imergpy.get_precipitation(
lat=6.9271,
lon=79.8612,
start_datetime="2025-01",
end_datetime="2025-01",
username=os.environ["EARTHDATA_USERNAME"],
password=os.environ["EARTHDATA_PASSWORD"],
run_type="final",
freq="monthly",
interp_method="nearest",
)
print(excel_path)
Accepted date formats:
YYYY-MMYYYY-MM-DDYYYY-MM-DD HH:MM
NASA Earthdata Credentials
You need a free NASA Earthdata account. After creating the account, authorize GES DISC under Earthdata authorized applications.
Do not write credentials into scripts. Use environment variables:
$env:EARTHDATA_USERNAME = "your_username"
$env:EARTHDATA_PASSWORD = "your_password"
Legal And Data Use Notice
imergpy is an independent open-source tool. It is not developed, endorsed, or certified by NASA, GES DISC, or the GPM mission team.
Users are responsible for:
- creating and using their own NASA Earthdata account,
- accepting and following NASA/GES DISC data access terms,
- citing NASA GPM IMERG data correctly in reports, papers, and products,
- checking data quality, latency, and suitability before operational or scientific use,
- keeping Earthdata usernames, passwords, and tokens private.
This software is provided under the MIT License without warranty.
Development
For local development:
git clone https://github.com/LakshithaSenavirathna/imergpy.git
cd imergpy
pip install -e ".[dev]"
Run tests:
pytest
Build package files:
python -m build
Publishing instructions are in PUBLISHING.md.
License
MIT License. Developed by Lakshitha S. Senavirathna.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imergpy-1.1.6.tar.gz.
File metadata
- Download URL: imergpy-1.1.6.tar.gz
- Upload date:
- Size: 169.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8044095b9c2f08cf54baece978bfb379c417b166b1f4abe00c793391c6f40cd4
|
|
| MD5 |
e595b4a16bd359728d49372341cbfd51
|
|
| BLAKE2b-256 |
abfd1c09c260dd918d595e40172e67a7e980c38e5d9537bc5121d602d8c9c1de
|
File details
Details for the file imergpy-1.1.6-py3-none-any.whl.
File metadata
- Download URL: imergpy-1.1.6-py3-none-any.whl
- Upload date:
- Size: 164.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
029c19122cfd0e4003c2b64e27077b4ac44a6260d675c41769f9fea0e3c2a3a5
|
|
| MD5 |
543a5de39423a6defca8a31340dc6cf8
|
|
| BLAKE2b-256 |
21132b7f455deb2fc3d0f2da31c9b17b80a5f432eb48666e00c8673c345261bc
|