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

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.2
File Size Uploaded Provenance Actions
pysegy-0.5.2.tar.gz 38.0 kB Without provenance Details for pysegy-0.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 76.9 kB

Release files / pysegy-0.5.2.tar.gz

Download URL pysegy-0.5.2.tar.gz
Size 38.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1ab3c8ce999af0e8e5a70a46517a460982f49b956f0d8886cbe9e70cbde74274
BLAKE2b-256 checksum
How to use checksums
0343144477646c322b1dc6557cfcd67754c46896d6840b7e52388445c18c3953
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.2-py3-none-any.whl

Download URL pysegy-0.5.2-py3-none-any.whl
Size 39.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d67535cd07213054a44f996ec0c3e7309481959f1605e00c0d4c6d2c988cdc0d
BLAKE2b-256 checksum
How to use checksums
cc60613efd62ff4f1d4558f204da03a769f6f3fd4fa958be1dadad487ed35336
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.2

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