xtgeo
XTGeo is a Python library for 3D grids, surfaces, wells, etc
What it is and what it does
XTGeo is a Python library for reading, manipulating, and writing subsurface reservoir modelling data used in oil and gas exploration and production. It provides high-performance handling of 3D corner-point grids, 2D regular surfaces, seismic cubes (via segyio), and well data, with a C backend and NumPy/Pandas integration for speed. The library is built by Equinor and targets geoscientists and reservoir engineers working with reservoir simulation software like RMS.
The package supports multiple industry-standard formats (RMS, Eclipse, SEGY, Irap binary) and allows cross-data operations—for example, slicing a surface with a seismic cube. It ships pre-built wheels for Python 3.11–3.14 on Linux, macOS (64-bit), and Windows, reducing installation friction. Well data, lines, and polygons are supported but noted as less mature than grid and surface handling.
Use it for:
- Load and modify 3D corner-point grids from RMS or Eclipse simulations, then export to a different format.
- Read seismic cubes in SEGY format and perform spatial operations (e.g., extract values at well locations).
- Manipulate regular 2D surfaces (maps) with rotation and resampling for reservoir analysis.
- Batch process well trajectory and log data alongside grid and surface data in a single workflow.
- Integrate subsurface data manipulation into a larger geoscience or reservoir engineering pipeline.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
XTGeo manipulates subsurface reservoir modelling data—3D grids, surfaces, seismic cubes, and wells—using NumPy and C backends for performance, with support for industry formats like RMS and Eclipse.
Yes, if you work with subsurface reservoir data in industry-standard formats. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and offers wheels for all major platforms. The LGPL-3.0 license is permissive for most use cases but requires attention if you plan to modify and redistribute the library. Install friction is moderate due to C compilation, but pre-built wheels mitigate this for standard platforms.
Install
xtgeo on PyPI
pip
pip install xtgeouv
uv add xtgeopoetry
poetry add xtgeoInstalling xtgeo
Before you install
Medium install friction due to C backend compilation requirements. The package is actively maintained (released 2 days ago) with wheels for Python 3.11–3.14 across Linux, macOS, and Windows, reducing friction for most users. Supports current Python versions.
License in practice
Licensed under LGPL-3.0 (copyleft). Any derivative work or modification must be distributed under the same license; static linking or bundling may trigger copyleft obligations depending on your deployment model.
Quickstart
pip install xtgeo
import xtgeo
mysurf = xtgeo.surface_from_file("myfile.gri")
mysurf.values[mysurf.values < 2000] = 2000
mysurf.to_file("newfile.gri")
Requires Python 3.11 or later; C backend compilation may be needed on platforms without pre-built wheels.
Verify before relying
- Maturity level of well data, line, and polygon support (described as 'somewhat immature' in the excerpt).
- Performance characteristics and scalability limits for very large grids or seismic cubes.
- Scope and cost of optional ROXAR API integration for RMS workflows.
Package facts
| License | LGPL-3.0 (copyleft) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 16 — deprecation, gstools, h5py, hdf5plugin, joblib, matplotlib, numpy, pandas, pyarrow, resfo, roffio, scipy, segyio, shapely, typing_extensions, xtgeoviz |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 129,681/month — #11,662 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xtgeo-4.25.1-cp311-cp311-macosx_11_0_arm64.whl; xtgeo-4.25.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; xtgeo-4.25.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; xtgeo-4.25.1-cp311-cp311-win_amd64.whl; xtgeo-4.25.1-cp312-cp312-macosx_11_0_arm64.whl; xtgeo-4.25.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; xtgeo-4.25.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; xtgeo-4.25.1-cp312-cp312-win_amd64.whl; xtgeo-4.25.1-cp313-cp313-macosx_11_0_arm64.whl; xtgeo-4.25.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; xtgeo-4.25.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; xtgeo-4.25.1-cp313-cp313-win_amd64.whl; xtgeo-4.25.1-cp314-cp314-macosx_11_0_arm64.whl; xtgeo-4.25.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; xtgeo-4.25.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; xtgeo-4.25.1-cp314-cp314-win_amd64.whl
Keywords: grids, surfaces, wells, cubes
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
geoh5pygeoh5py provides a Python API to read, write,…
copyleft · top 15,000 on PyPI
segyioSegyio reads and writes SEG-Y formatted seismic…
copyleft · top 15,000 on PyPI
xtgeovizProvides plotting functions for xtgeo objects,…
copyleft · top 15,000 on PyPI
isosurfacesConstructs isolines and isosurfaces of 2D and…
permissive · top 15,000 on PyPI
obspyObsPy provides a Python framework for…
copyleft · top 15,000 on PyPI
resfo-utilitiesresfo-utilities parses and processes output…
copyleft · top 15,000 on PyPI
resforesfo parses binary and ASCII output files from…
copyleft · top 15,000 on PyPI
resdataResData reads and writes result files from…
copyleft · top 15,000 on PyPI
oil-reservoir-synthesizerGenerates synthetic oil reservoir simulator…
copyleft · top 15,000 on PyPI
xarray-spatialxarray-spatial provides 150+ functions for…
permissive · top 15,000 on PyPI