Skip to main content

pysegy

CI Docs codecov PyPI version

pysegy is a minimal Python library for working with SEGY Rev 1 data. The project provides helpers to read and write files as well as utilities to scan large surveys without loading every trace in memory.

Capabilities

  • Read complete SEGY files with segy_read and access both binary and trace headers.
  • Write new data sets using segy_write from NumPy arrays.
  • Lazily inspect large archives via segy_scan and the SegyScan object.
  • Retrieve individual header fields with automatic scaling through get_header.
  • Compatible with any fsspec filesystem for local or remote storage.

Installation

Install the project in editable mode from the repository root:

python -m pip install -e .

Or to install the latest pypi release

pip install pysegy

Testing

Run the unit tests with pytest:

pytest -vs

The tests run automatically on GitHub Actions with coverage reports uploaded to Codecov.

Scan benchmark

The scan benchmark compares sequential and threaded scanning of a file or directory:

python benchmarks/scan_benchmark.py /path/to/large.segy
python benchmarks/scan_benchmark.py /path/to/survey --pattern '*.segy'

Without an argument the bundled data directory is scanned. Threading pays off once several files or many shots are involved; a single small file is dominated by the fixed cost of opening it.

Inspiration

This project started as a lightweight port of the Julia package SegyIO.jl. The goal is to provide a similar user experience for Python while keeping the code base small and easy to understand.

Metadata

Release files for pysegy 0.5.4

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

Source distribution (sdist)

Source distribution for pysegy 0.5.4
File Size Uploaded Provenance Actions
pysegy-0.5.4.tar.gz 40.8 kB Without provenance Details for pysegy-0.5.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysegy 0.5.4
File Interpreter ABI Platform Actions
pysegy-0.5.4-py3-none-any.whl Python 3 none any Details for pysegy-0.5.4-py3-none-any.whl

Total release size: 82.7 kB

Release files / pysegy-0.5.4.tar.gz

Download URL pysegy-0.5.4.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1b325cbf14a9ddcddb514d5727d08d07080d2991fe31ae0bb0342c47e0d3df33
BLAKE2b-256 checksum
How to use checksums
7767e0edcf62a8448fc821b815db15d5671f953cde346bacd781c41e575b3660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pysegy-0.5.4-py3-none-any.whl

Download URL pysegy-0.5.4-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2d27cd16974629a2b19ae4f26ca4d788ff158614a813ec64ab43fbbee30d7e3
BLAKE2b-256 checksum
How to use checksums
d061d27b3fe81244845b9041dae8ce5eda1910cfe678586b1f6b65368868df87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for pysegy 0.5.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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