gstools
GSTools: A geostatistical toolbox.
What it is and what it does
GSTools is a Python geostatistics library for modelling and simulating spatial phenomena. It implements kriging (simple, ordinary, universal, and external drift variants), random field generation via the randomisation method, variogram estimation and fitting, and support for user-defined covariance models. The library handles structured and unstructured spatial data in 1D, 2D, and 3D, with optional geographic coordinate support and VTK export for visualization.
The package is built on numpy and scipy, with optional Cython acceleration via gstools-cython and MCMC sampling via emcee for parameter estimation. It targets researchers and practitioners in hydrogeology, geophysics, and environmental science who need to interpolate sparse measurements, generate ensemble field realizations, or analyse spatial structure through variograms. Conditioned field generation allows ensemble members to respect measurement constraints while capturing spatial uncertainty.
Use it for:
- Generate ensemble realizations of hydrogeological properties conditioned to well measurements for uncertainty quantification.
- Estimate and fit variograms from scattered spatial data to characterize spatial correlation structure.
- Interpolate sparse measurements using kriging to create continuous field estimates with uncertainty bounds.
- Create synthetic spatial random fields with specified covariance structure for Monte Carlo simulation studies.
- Export 3D spatial fields to VTK format for visualization in ParaView or analysis with PyVista.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
GSTools provides geostatistical tools for spatial random field generation, kriging, variogram estimation, and covariance modelling with support for structured and unstructured data in 1D, 2D, and 3D.
Yes. GSTools is actively maintained, has no known vulnerabilities, supports current Python versions, and provides a comprehensive toolkit for geostatistical modelling. The LGPL-3.0 license is copyleft; ensure your use case permits derivative-work licensing. Install friction is low. It is well-suited for research, academic, and open-source projects requiring spatial statistics and field simulation.
Install
gstools on PyPI
pip
pip install gstoolsuv
uv add gstoolspoetry
poetry add gstoolsInstalling gstools
Before you install
Low install friction with a pure-wheel distribution. Active maintenance with recent commits and a stable release cadence; supports Python 3.8 through 3.13. Runtime dependencies include scipy, numpy, and optional Cython acceleration via gstools-cython.
License in practice
Licensed under LGPL-3.0 (copyleft). Derivative works and modifications must be released under the same license; proprietary use requires careful review of linking and distribution terms.
Quickstart
import gstools as gs
import numpy as np
# Generate a 2D Gaussian random field
model = gs.Gaussian(dim=2, var=1, len_scale=10)
srf = gs.SRF(model)
field = srf((range(100), range(100)), mesh_type='structured')
Verify before relying
- Whether gstools-cython acceleration is automatically installed and used by default, or requires separate setup steps.
- Performance characteristics and scalability limits for very large fields or high-dimensional problems.
- Whether the package supports GPU acceleration or distributed computing beyond what emcee provides.
Package facts
| License | LGPL-3.0 (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — emcee, gstools-cython, hankel, meshio, numpy, pyevtk, scipy |
| Maintenance | actively maintained — 473 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 136,891/month — #11,383 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gstools-1.7.0-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
gstools-cythonProvides optimized Cython implementations of…
copyleft · top 15,000 on PyPI
PeakUtilsPeakUtils detects peaks in 1D data and refines…
permissive · top 15,000 on PyPI
spglmFits Gaussian, Poisson, QuasiPoisson, and…
permissive · top 15,000 on PyPI
archProvides ARCH/GARCH volatility models, unit…
unclear · top 5,000 on PyPI
spregspreg estimates simultaneous autoregressive…
permissive · top 15,000 on PyPI
mgwrCalibrates multiscale and traditional…
permissive · top 15,000 on PyPI
spintSpInt calibrates spatial interaction models…
permissive · top 15,000 on PyPI
gamma-pytoolsA collection of machine learning and…
permissive · top 15,000 on PyPI
xtgeovizProvides plotting functions for xtgeo objects,…
copyleft · top 15,000 on PyPI
accessCalculates spatial accessibility metrics to…
permissive · top 15,000 on PyPI