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.3

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.3
File Size Uploaded Provenance Actions
pysegy-0.5.3.tar.gz 39.8 kB Without provenance Details for pysegy-0.5.3.tar.gz

Built distribution (wheel)

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

Total release size: 80.6 kB

Release files / pysegy-0.5.3.tar.gz

Download URL pysegy-0.5.3.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c2fd81cc0c1fc895ac0c4d1104ed7800ee37b36f826cfa12fc317f4311815c24
BLAKE2b-256 checksum
How to use checksums
6c657d151e644f940a8ea553db896924c4948e33bc9fbe9ac5d5e9e4018264b8
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.3-py3-none-any.whl

Download URL pysegy-0.5.3-py3-none-any.whl
Size 40.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d29a116e12191717d364b840bd21cb28619c5bf8cef595ddd5202cac33700a4
BLAKE2b-256 checksum
How to use checksums
981ea526930731d5753783a62472850d5f2584182da64934fad7a81702e782c2
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.3

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