skillfed

gstools

GSTools: A geostatistical toolbox.

gstools v1.7.0 136.9K downloads/30d#11,383 on PyPI649
Copyleft license LGPL-3.0 Active released

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 gstools

uv

uv add gstools

poetry

poetry add gstools

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: End Users/DesktopIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Natural Language :: EnglishOperating System :: MacOSOperating System :: MicrosoftOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: GISTopic :: Scientific/Engineering :: HydrologyTopic :: Scientific/Engineering :: MathematicsTopic :: Scientific/Engineering :: PhysicsTopic :: Utilities

Tags

geostatistical random field generationkriging interpolation spatial datavariogram estimation fittingcovariance models spatial statisticsconditioned random field simulationspatial data analysis pythongeostatistics toolkit
geostatisticsspatial-statisticskriging

More Scientific/Engineering packages