Skip to main content

PyPI

SPEI

A simple Python package to calculate drought indices for time series such as the SPI (Standardized Precipitation Index), SPEI (Standardized Precipitation Evaporation Index) and SGI (Standardized Groundwater Index). There are other great packages available to calculate these indices However, they are either written in R such as SPEI or don't have the Standardized Groundwater Index such as climate_indices. Additionaly, these packages provide ways to analyse spatial data and calculate potential evaporation. This makes these packages complex since it is easier to only deal with time series. Therefore, this package uses the popular Python packages such as Pandas and Scipy to make it easy but versitile for the user to calculate the drought indices. With the use of Scipy all distributions available in the library can be used to fit the data. However, there are general recommendations for distributions when calculating the SPEI, SPI an SGI.

Note that, all time series have to be calculated in advance and be provided as a pandas Series. For the calculation of potential evaporation, we refer to pyet.

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

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

Installation

To get the latest stable version install using:

pip install spei

To get the development version download the GitHub code to your computer. Use cd to get to the download directory and install using:

pip install -e .

Nice to haves in the future:

  • Add way to identify best distribution on time series (with Scipy, Fitter or distfit)

  • Check SGI for other distributions

Feel free to contribute!

Literature

  1. B. Lloyd-Hughes and M.A. Saunders (2002) - A Drought Climatology for Europe. DOI: 10.1002/joc.846
  2. S.M. Vicente-Serrano, 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. J.P.Bloomfield and B.P. Marchant, B. P. (2013) - Analysis of groundwater drought building on the standardised precipitation index approach. DOI: 10.5194/hess-17-4769-2013
  4. A. Babre, 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. E. Tijdeman, 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

Metadata

Release files for spei 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spei 0.1.8
File Size Uploaded
spei-0.1.8.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spei 0.1.8
File Interpreter ABI Platform
spei-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / spei-0.1.8.tar.gz

Download URL spei-0.1.8.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5988266dffea8b711bf45393d98b6be123ecac2a0eeca6da2617fed45a9a5b8d
BLAKE2b-256 checksum
How to use checksums
c025dfa9183f5d84aab1a28813dd69b0cf753a8c59eb1df6d99522e42f59870f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / spei-0.1.8-py3-none-any.whl

Download URL spei-0.1.8-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
053ca7acdf969abe31c252f864b55ae4491d3014c11b6746ab4e8aae509e0026
BLAKE2b-256 checksum
How to use checksums
b070f75078689b16ff24aafd1e37251c4ce3df3846dec989ec6288759fd321cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page