SPEI

SPEI: A Python package for calculating and visualizing drought indices - Published in JOSS (2025)

https://github.com/martinvonk/spei

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 23 DOI reference(s) in README and JOSS metadata
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

drought drought-index drought-indices groundwater hydrology python sgi spei spi timeseries

Scientific Fields

Mathematics Computer Science - 84% confidence
Last synced: 4 months ago · JSON representation ·

Repository

A Python package for calculating and visualizing drought indices such as the SPI, SPEI and SGI.

Basic Info
Statistics
  • Stars: 95
  • Watchers: 2
  • Forks: 12
  • Open Issues: 3
  • Releases: 27
Topics
drought drought-index drought-indices groundwater hydrology python sgi spei spi timeseries
Created over 3 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Citation

README.md

SPEI

PyPI PyPi Supported Python Versions Code Size PyPi Downloads License DOI

Tests CodacyCoverage CodacyGrade Typed: MyPy Formatter and Linter: ruff

SPEI is a simple Python package to calculate drought indices for hydrological time series. This package uses popular Python packages such as Pandas and Scipy to make it easy and versatile for the user to calculate the drought indices. Pandas Series are great for dealing with time series; providing interpolation, rolling average, and other manipulation options. SciPy enables us to use all different kinds of distributions to fit the data. Different popular drought indices are supported such as the SPI (Standardized Precipitation Index), SPEI (Standardized Precipitation Evaporation Index), and SGI (Standardized Groundwater Index).

If you happen to use this package, please cite: Vonk, M. A. (2024). SPEI: A simple Python package to calculate and visualize drought indices (vX.X.X). Zenodo. https://doi.org/10.5281/zenodo.10816741.

Available Drought Indices

| Drought Index | Abbreviation | Literature | | --------------------------------------------- | ------------ | ---------- | | Standardized Precipitation Index | SPI | 1 | | Standardized Precipitation Evaporation Index* | SPEI | 2 | | Standardized Groundwater Index | SGI | 3,4 | | Standardized Streamflow Index | SSFI | 5,6 | | Standardized Soil Moisture Index | SSMI | 7 |

The package is not limited to only these five drought indices. If any of the distributions in the Scipy library is valid on the observed hydrological series, the drought index can be calculated.

*For the calculation of potential evaporation, take a look at pyet. This is another great package that also uses pandas Series to calculate different kinds of potential evaporation time series.

Installation

To get the latest stable version install using:

pip install spei

To get the development version download or clone the GitHub repository to your local device. Install using:

pip install -e <download_directory>

Literature

This list of scientific literature is helpful as a reference to understand the context and application of drought indices.

  1. Lloyd-Hughes, B. and M.A. Saunders (2002) - A Drought Climatology for Europe. DOI: 10.1002/joc.846
  2. Vicente-Serrano, S.M., S. Beguería and J.I. López-Moreno (2010) - A Multi-scalar drought index sensitive to global warming: The Standardized Precipitation Evapotranspiration Index. DOI: 10.1175/2009JCLI2909.1
  3. Bloomfield, J.P. and B.P. Marchant (2013) - Analysis of groundwater drought building on the standardised precipitation index approach. DOI: 10.5194/hess-17-4769-2013
  4. Babre, A., A. Kalvāns, Z. Avotniece, I. Retiķe, J. Bikše, K.P.M. Jemeljanova, A. Zelenkevičs and A. Dēliņa (2022) - The use of predefined drought indices for the assessment of groundwater drought episodes in the Baltic States over the period 1989–2018. DOI: 10.1016/j.ejrh.2022.101049
  5. Vicente-Serrano, S. M., J. I. López-Moreno, S. Beguería, J. Lorenzo-Lacruz, C. Azorin-Molina, and E. Morán-Tejeda (2012). Accurate Computation of a Streamflow Drought Index. Journal of Hydrologic Engineering. American Society of Civil Engineers. DOI: 10.1061/(asce)he.1943-5584.0000433
  6. Tijdeman, E., K. Stahl and L.M. Tallaksen (2020) - Drought characteristics derived based on the Standardized Streamflow Index: A large sample comparison for parametric and nonparametric methods. DOI: 10.1029/2019WR026315
  7. Carrão. H., Russo, S., Sepulcre-Canto, G., Barbosa, P.: An empirical standardized soil moisture index for agricultural drought assessment from remotely sensed data. DOI: 10.1016/j.jag.2015.06.011s

Publications

These are scientific publications that use and cite this Python package via Zenodo:

van Mourik, J., Ruijsch, D., van der Wiel, K., Hazeleger, W., & Wanders, N. (2025). Regional drivers and characteristics of multi-year droughts. Weather and Climate Extremes, 48, 100748. https://doi.org/10.1016/j.wace.2025.100748

Segura-Barrero, R., Lauvaux, T., Lian, J., Ciais, P., Badia, A., Ventura, S., Bazzi, H., Abbessi, E., Fu, Z., Xiao, J., Li, X., & Villalba, G. (2025). Heat and Drought Events Alter Biogenic Capacity to Balance CO2 Budget in South-Western Europe. Global biogeochemical cycles, 39(1), e2024GB008163. https://doi.org/10.1029/2024GB008163

Adla, S., Šaponjić, A., Tyagi, A., Nagi, A., Pastore, P., & Pande, S. (2024). Steering agricultural interventions towards sustained irrigation adoption by farmers: socio-psychological analysis of irrigation practices in Maharashtra, India. Hydrological Sciences Journal, 69(12), 1586–1603. https://doi.org/10.1080/02626667.2024.2376709

Panigrahi, S., Vidyarthi, V.K. (2025). Assessing the Suitability of SPI and SPEI in Steppe Hot and Arid Climatic Zones in India. In: Sefelnasr, A., Sherif, M., Singh, V.P. (eds) Water Resources Management and Sustainability. Water Science and Technology Library, vol 114. Springer, Cham. https://doi.org/10.1007/978-3-031-80520-2_12

Owner

  • Name: Martin Vonk
  • Login: martinvonk
  • Kind: user
  • Location: Netherlands
  • Company: @tudelft, @ArtesiaWater

JOSS Publication

SPEI: A Python package for calculating and visualizing drought indices
Published
July 29, 2025
Volume 10, Issue 111, Page 8454
Authors
Martin A. Vonk ORCID
Department of Water Management, Faculty of Civil Engineering and Geosciences, Delft University of Technology, Delft, South Holland, The Netherlands, Artesia B.V., Schoonhoven, South Holland, The Netherlands
Editor
Mengqi Zhao ORCID
Tags
hydrology drought time series

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
  - family-names: Vonk
    given-names: M. A.
    orcid: "https://orcid.org/0009-0007-3528-2991"
doi: 10.5281/zenodo.16441123
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
    - family-names: Vonk
      given-names: M. A.
      orcid: "https://orcid.org/0009-0007-3528-2991"
  date-published: 2025-07-29
  doi: 10.21105/joss.08454
  issn: 2475-9066
  issue: 111
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 8454
  title: "SPEI: A Python package for calculating and visualizing drought
    indices"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.08454"
  volume: 10
title: "SPEI: A Python package for calculating and visualizing drought
  indices"

GitHub Events

Total
  • Create event: 12
  • Release event: 4
  • Issues event: 25
  • Watch event: 19
  • Delete event: 6
  • Issue comment event: 19
  • Push event: 222
  • Pull request review comment event: 9
  • Pull request review event: 6
  • Pull request event: 21
  • Fork event: 6
Last Year
  • Create event: 12
  • Release event: 4
  • Issues event: 25
  • Watch event: 19
  • Delete event: 6
  • Issue comment event: 19
  • Push event: 222
  • Pull request review comment event: 9
  • Pull request review event: 6
  • Pull request event: 21
  • Fork event: 6

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 570
  • Total Committers: 1
  • Avg Commits per committer: 570.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 339
  • Committers: 1
  • Avg Commits per committer: 339.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
martinvonk v****t@g****m 570

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 25
  • Total pull requests: 59
  • Average time to close issues: 17 days
  • Average time to close pull requests: about 9 hours
  • Total issue authors: 15
  • Total pull request authors: 1
  • Average comments per issue: 1.28
  • Average comments per pull request: 0.05
  • Merged pull requests: 56
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 16
  • Pull requests: 22
  • Average time to close issues: 21 days
  • Average time to close pull requests: about 11 hours
  • Issue authors: 8
  • Pull request authors: 1
  • Average comments per issue: 1.06
  • Average comments per pull request: 0.0
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • martinvonk (10)
  • filipematos95 (2)
  • cherryleh (1)
  • luizfiscina (1)
  • Appleweier (1)
  • 1JunGu (1)
  • simoonoses1 (1)
  • xiaoqi1010 (1)
  • Mahsabzg (1)
  • shirazi25 (1)
  • agnespeltan (1)
  • mengqi-z (1)
  • mahronid (1)
  • juliammassing (1)
  • njdepsky (1)
Pull Request Authors
  • martinvonk (59)
Top Labels
Issue Labels
question (5) documentation (4) code quality (1)
Pull Request Labels
enhancement (20) code quality (18) documentation (15) bug (3)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 902 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 25
  • Total maintainers: 1
pypi.org: spei

A simple Python package to calculate drought indices for time series such as the SPI, SPEI and SGI.

  • Documentation: https://spei.readthedocs.io/
  • License: MIT License Copyright (c) 2022 Martin Vonk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.8.0
    published 5 months ago
  • Versions: 25
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 902 Last month
Rankings
Dependent packages count: 10.0%
Downloads: 12.5%
Average: 14.7%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • matplotlib *
  • numpy *
  • pandas *
  • scipy *
.github/workflows/auto-author-assign.yml actions
  • toshimaru/auto-author-assign v1.6.2 composite