Skip to main content

segyrs

segyrs is my personal tool for handling SEG-Y files. I wrote it because I had issues handling SEG-Y files with the existing libraries. It is a Rust core with Python bindings.

segyrs reads and writes SEG-Y rev 0, 1, 2.0 and 2.1 on every core. You open a file, select by label or position, and get numpy arrays back. It draws its own pictures in a notebook, and in a native GPU window when you build it from the repository. Numpy is the only Python runtime dependency: no xarray, no dask, no matplotlib, and no command-line program.

segyrs is alpha software, and 0.1.0 is its first public release: the API may still change between minor versions. Reading, writing, in-place edits, the streaming operations and the notebook picture work in Rust and Python, and every planned milestone is in (Roadmap). Object-store reads and Zarr export are in the same wheel and are experimental. The viewer window is not part of the 0.1.0 release: it builds from the repository and will be published later.

Docs · User guide · Benchmarks · Design · Roadmap

Install

pip install segyrs

That installs one abi3 wheel for CPython 3.11 and newer on Linux (x86_64 and aarch64 with glibc 2.28 or newer, x86_64 with musl 1.2 or newer), macOS (Intel and Apple silicon) and Windows x64. On any other platform, pip builds segyrs from the sdist, which needs Rust 1.89 or newer (rustup.rs) and a C compiler. Either way you get reading, selection, headers, writing, in-place edits, the streaming operations, the notebook picture, segyrs.open on s3://, gs://, az:// and http(s):// URLs, and Volume.to_zarr. Numpy is its only dependency. segyrs is the only package of the 0.1.0 release.

Install and release has the platform table. The native viewer window (segyrs.view) is not part of the 0.1.0 release on PyPI; it will be published later. To build segyrs and the viewer from a checkout, use mise:

mise install       # the pinned Rust, Python, maturin and uv
mise run build     # segyrs and the viewer, into .venv

Quick start

No SEG-Y file at hand? This writes a small one, 50 inlines by 60 crosslines of 200 samples:

import numpy as np
import segyrs

cube = np.random.default_rng(0).standard_normal((50, 60, 200)).astype(np.float32)
segyrs.create("survey.sgy", cube, sample_format="ibm_float32", sample_interval_us=4000,
              inline=np.arange(1000, 1050), crossline=np.arange(2000, 2060))

Then open it, or your own file with its own labels:

vol = segyrs.open("survey.sgy")      # headers only; no sample byte is read yet
vol.dims                             # ("inline", "crossline", "time")
vol.geometry.kind                    # "inline_major", "unsorted", "sparse", ...

il = vol.sel(inline=1020)            # by label: one inline, still lazy
il.numpy()                           # reads that inline's traces, nothing else
vol.isel(crossline=0, time=slice(0, 100)).numpy()   # by position

vol.headers["cdp_x"]                 # one numpy column per header field

pts = vol.sel_points(inline=[1001, 1020, 1049], crossline=[2005, 2030, 2059])
pts.numpy()                          # scattered traces in one parallel read

il.plot().save("il1020.png")         # drawn in Rust, no matplotlib
# segyrs.view(vol)                   # native wgpu window, built from the repository; needs a display

vol.sel(inline=slice(1010, 1030)).to_segy("crop.sgy")   # IBM stays IBM
with segyrs.edit("crop.sgy") as ed:                     # in place, same layout
    ed.set_header("offset", np.full(ed.n_traces, 25, np.int32))
segyrs.validate("crop.sgy")                             # the layout, or ValidationError

In Jupyter a 2D selection shows itself as a picture. segyrs.view opens a window on the same plane. The user guide covers every option.

What segyrs fixes

segyrs is a clean-room rewrite. It follows the SEG technical standards, and uses segyio only as a behavioural reference: its documentation and its issues, never its code. Each upstream problem is a GitHub issue here with a ledger id (S- for segyio, X- for xarray, segysak and mdio), and a test carries the same id. The segyio ledger and the xarray ledger list them all.

segyio segyrs
An unsorted or sparse file does not open with geometry (S-14, S-16) It opens. geometry.kind names the layout, and sel(inline=..., crossline=...) still finds the trace (S-15)
A file larger than RAM cannot be wrapped as a lazy array (S-12) Open reads no samples. Each selection reads its own traces
Header columns mean a Python loop per trace (S-07, S-09) vol.headers["cdp_x"] decodes one column on all cores
IBM float overflow can become NaN (S-01) It becomes infinity. Integers stay integers, and every rev 2 format decodes (S-04)
The rev 2 byte-order word is not read, and raw header buffers stay big-endian (S-22, S-23) The rev 2 signature picks the byte order. Decoded values are native, raw bytes stay in file order
One error message covers three different problems (S-25) SampleCountMismatch, EndianMismatch and NonUniformTraceLength
Writing a numpy cube needs a spec object (S-31) segyrs.create takes the array. to_segy keeps the source format (S-35)
A cropped window can lose its time (S-36) The delay moves with the window
No picture in the quick start (S-06) vol.sel(inline=...) is a picture in Jupyter

Design ties each rule to its ledger id and the upstream title.

Benchmarks

Measured on 2026-11-17 on one machine (Intel i9-13980HX, 32 threads, 30 GB RAM, Micron 2400 NVMe), every number a median of interleaved rounds, each measurement in a fresh process. Cold means the file was evicted from the page cache first. The other side is segyio 1.9.15 with f.mmap(), its documented speed-up. The benchmarks page has every row, the method, the load, the losses and the reasons for them, and benchmarks/ holds the scripts and the commands that produced them.

1000 x 1000 traces of 1000 samples (4.24 GB, IEEE float32, inline-sorted):

Operation segyio segyrs
Open, cold 0.2965 s 0.0335 s
One crossline, cold 1.0386 s 0.0420 s
Whole cube into numpy, warm 0.8441 s 0.2505 s
One inline, warm 0.0014 s 0.0020 s
1000 random traces, one call each, warm 0.0097 s 0.0140 s

Writing, on 1000000 traces: a whole-file copy synced to disk took 0.349 s against 24.647 s, and setting one header word on every trace in place took 0.486 s against 3.975 s.

segyio wins the last two rows of the table: a warm single read is mostly per-call overhead, and segyrs pays for a labelled Volume on each call. It also opens an irregular file faster when you pass ignore_geometry=True, because it then reads no trace headers. segyrs scans and checks them so the file opens with its real layout. index_cache cuts that cost on the next open.

Documentation

The same pages build into a site with mise run docs.

Licence

Copyright 2026 the segyrs authors. segyrs is licensed under the Apache License 2.0 (Apache-2.0): LICENSE. Each wheel also carries THIRD-PARTY-LICENSES.txt, the licences of the Rust crates linked into it. The test files in test-data/ are not under the segyrs licence: they come from segyio (LGPL-3.0) and include F3 Netherlands field data (CC BY-SA 3.0), and they are not in the packages. See test-data/LICENSE.md.

Metadata

Release files for segyrs 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for segyrs 0.1.0
File Size Uploaded Provenance Actions
segyrs-0.1.0.tar.gz 292.0 kB With provenance Details for segyrs-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for segyrs 0.1.0
File Actions
segyrs-0.1.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for segyrs-0.1.0-cp311-abi3-win_amd64.whl
segyrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for segyrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
segyrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for segyrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
segyrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for segyrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
segyrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for segyrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
segyrs-0.1.0-cp311-abi3-macosx_10_15_x86_64.whl CPython 3.11 abi3 macOS 10.15+ x86-64 Details for segyrs-0.1.0-cp311-abi3-macosx_10_15_x86_64.whl

Total release size: 32.9 MB

Release files / segyrs-0.1.0.tar.gz

Download URL segyrs-0.1.0.tar.gz
Size 292.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1316bf5c7e24bcb4c20e2bfe8bfcc65635f2d49868339a7fc9fd332d5e99eec8
BLAKE2b-256 checksum
How to use checksums
75578e7b77c2b4d67d6a7281ecb9a6ebf0c0b381d2db0e961505846f12903cab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / segyrs-0.1.0-cp311-abi3-win_amd64.whl

Download URL segyrs-0.1.0-cp311-abi3-win_amd64.whl
Size 5.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
13c4ce054c6f2607024bdeaa967fcf89aa481d27b8e9c285bae2b66edcf76e0d
BLAKE2b-256 checksum
How to use checksums
d01bbf74a60df568785b53f7f31b6470f6fe715e163814363a6892b187e54463
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / segyrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL segyrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 5.8 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
a15f74d511dadda7e015b45fefef6f0a5d199090d7059547e5db426e374f7202
BLAKE2b-256 checksum
How to use checksums
85c57cf941f6f4131a8e239270fc912e69a0b267bdb92aa0c4a1358558bb0447
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / segyrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL segyrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 5.8 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
1f2ee9c59e6fe52aa4fab4dccfe2a4ae4bd93c5189a15ac94896aecc7f5f8216
BLAKE2b-256 checksum
How to use checksums
8e1599da66444f37b38e77c0bbee325a7817102ae0e691fec0be4c45a3a623e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / segyrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL segyrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 5.4 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
f02a69e1cc7a2efed02c374142fc8c4a5fb3501b6fe3a3999046c1b1ef41947f
BLAKE2b-256 checksum
How to use checksums
e831428d32e43a4b23ec25d101922870d55fb1dc5ac467dfa82de1756cb01055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / segyrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL segyrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Size 4.6 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0f2853eb3649d144db994e184eb871184542bb1569b4a497a6cabc55cbec300b
BLAKE2b-256 checksum
How to use checksums
bea58f8825a013415ef78c2cb360e77f861847c286bcda6b0472170b82c5eba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / segyrs-0.1.0-cp311-abi3-macosx_10_15_x86_64.whl

Download URL segyrs-0.1.0-cp311-abi3-macosx_10_15_x86_64.whl
Size 5.5 MB
Tags CPython 3.11 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
af91c9006d6ab0df1b020bcc74dfb2cbf8263134bc7f41acd437fdcc91e1ca5b
BLAKE2b-256 checksum
How to use checksums
2bdca4089cfc005c539ed592ef594bdede4f901616928fcd068ea25ccc84fd5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for segyrs 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for segyrs-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

7 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page