Python Libraries Every Geoscientist Should Know in 2026
From PyGMT to TorchGeo, the Python geoscience ecosystem has exploded. Here are the essential tools for modern computational earth science.
Masood Sultan
Apr 08, 2026 · 2 min read
The Python Geoscience Stack
The days of proprietary GIS software monopolies are numbered. Python has become the lingua franca of computational geoscience. Here are the libraries that matter most in 2026.
Data Processing & Analysis
xarray
The backbone of modern geoscience computing. xarray provides labeled, multi-dimensional arrays that understand coordinates, dimensions, and metadata. If you're working with NetCDF, GRIB, or Zarr data — you need xarray.
import xarray as xr
# Open a climate model output
ds = xr.open_dataset('temperature.nc')
# Select a region and compute anomaly
anomaly = ds.temperature.sel(lat=slice(30, 60), lon=slice(-10, 40)) - ds.temperature.mean('time')
Dask
When your data doesn't fit in memory. Dask parallelizes xarray operations across cores or clusters, letting you process terabyte-scale datasets on a laptop.
Visualization
PyGMT
The Python wrapper for Generic Mapping Tools. Publication-quality maps with clean syntax:
import pygmt
fig = pygmt.Figure()
fig.coast(region="g", projection="W15c", land="lightgray", water="lightblue", frame=True)
fig.show()
GeoViews + HoloViews
Interactive, web-based geospatial visualization built on Bokeh. Perfect for Jupyter notebooks and exploratory analysis.
Machine Learning for Earth Science
TorchGeo
PyTorch datasets and transforms for geospatial data. Handles satellite imagery, point clouds, and weather data natively:
from torchgeo.datasets import Landsat
from torchgeo.datamodules import InriaAerialImageLabelingDataModule
Verde
Spatial data processing by the Fatiando a Terra project. Gridding, trend removal, cross-validation for spatial data:
import verde as vd
chain = vd.Chain([vd.Trend(degree=1), vd.Spline()])
chain.fit(coordinates, data)
APIs & Data Access
- CDS API: Access ERA5, CMIP6, and more from the Copernicus Climate Data Store
- Planetary Computer: Microsoft's STAC catalog for satellite imagery
- Google Earth Engine:
eePython API for planetary-scale analysis
My Recommendations
- Start with xarray — it's the foundation
- Learn cartopy or PyGMT for maps
- Use TorchGeo if you're doing ML on satellite data
- Keep an eye on Pangeo — the community driving cloud-native geoscience
The barrier to entry in computational geoscience has never been lower. The tools are free, the data is open, and the problems are literally world-changing.
What Python libraries do you use for geoscience? Drop a comment or reach out on GitHub.
Written by Masood Sultan
Computational geoscientist and AI engineer. Focuses on spatial data algorithms, climate modeling architectures, and open-source intelligence scraping.
execute ./portfolio.sh