Skip to main content

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

Project description

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:

  • Improve notebook documentation

  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spei-0.2.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spei-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file spei-0.2.0.tar.gz.

File metadata

  • Download URL: spei-0.2.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for spei-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d88f50c31f50b41a1a8ebe6184dc97773497dce248291024632d25302d1f6c8d
MD5 a03673b2323621224a22bc94bbca296f
BLAKE2b-256 8c6a2766a1a99c966c5626c314816348596b46417b4240bcb0cf39fe72b58942

See more details on using hashes here.

File details

Details for the file spei-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spei-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for spei-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6d9e6fb6da38e228a5d8b08709fea466ee36c6a9634caf9d6847827d402bd58
MD5 2f763fbfa26cdaf9a18f03595353f68f
BLAKE2b-256 85df635222b89e6d8d0a3ed3b04c655339a60ca4b807063f32924a40f0a7695f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page