Skip to main content

A high-performance LAS (Log ASCII Standard) file reader written in Rust

Project description

las_read_rs 🦀

PyPI version CI

High-performance LAS (Log ASCII Standard) file reader written in Rust with Python bindings. A faster alternative to pure Python implementations, capable of parsing large geophysical log files efficiently.

⚡ Performance

Benchmarked with a 92 MB LAS file (400 curves, 21,842 points each):

Library Read Time Speedup
las_read_rs (Rust) ~1.0s 9x faster 🚀
lasio (Python) ~9.0s baseline

🚀 Installation

Requirements:

  • Python 3.8 or higher
  • Supported OS: Windows, macOS, Linux
pip install las_read_rs

Optional dependencies for export features:

pip install pandas          # For DataFrame and CSV export
pip install openpyxl        # For Excel export
pip install polars          # For Polars DataFrame

📖 Quick Start

import lasio_rs

# Read a LAS file
las = lasio_rs.read("well_log.las")

# Access metadata
print(las.version['VERS'].value)  # "2.0"
print(las.well['WELL'].value)     # Well name

# Access curve data directly
depth = las['DEPT']  # Returns list of floats
gr = las['GR']       # Gamma Ray values

# List all curves
for curve_name in las.keys():
    curve = las.curves[curve_name]
    print(f"{curve_name} ({curve.unit}): {len(curve.data)} points")

📊 DataFrame Conversion

# Convert to pandas DataFrame
df = las.to_df()
print(df.head())

# Convert to polars DataFrame
df_polars = las.to_polars()

💾 Export Formats

CSV Export

las.to_csv("output.csv")

Excel Export

las.to_excel("output.xlsx", sheet_name="Well Data")

LAS Export (2.0 and 3.0)

# Export as LAS 2.0
las.to_las("output_v2.las", version="2.0")

# Export as LAS 3.0
las.to_las("output_v3.las", version="3.0")

🔧 API Reference

lasio_rs.read(path)

Reads a LAS file and returns a LASFile object.

LASFile Properties

Property Description
version Version section (VERS, WRAP)
well Well information (STRT, STOP, STEP, NULL, WELL, etc.)
curves Curve metadata and data
params Parameter section

LASFile Methods

Method Description
las[mnemonic] Get curve data as list
las.keys() List curve mnemonics
las.to_df() Convert to pandas DataFrame
las.to_polars() Convert to polars DataFrame
las.to_csv(path) Export to CSV
las.to_excel(path) Export to Excel
las.to_las(path, version) Export to LAS format

🏗️ Building from Source

Requirements:

  • Python 3.7+
  • Rust (cargo, rustc)
  • maturin
git clone https://github.com/jemilianofl/lasio-rs.git
cd lasio-rs
pip install maturin
maturin develop --release

📋 Supported LAS Versions

  • ✅ LAS 2.0
  • ✅ LAS 3.0 (read support)
  • ✅ Export to LAS 2.0/3.0

🤝 Compatibility with lasio

las_read_rs provides a similar API to the popular lasio library:

# lasio style
import lasio
las = lasio.read("file.las")
depth = las['DEPT']

# las_read_rs style (same!)
import lasio_rs
las = lasio_rs.read("file.las")
depth = las['DEPT']

📄 License

MIT

🙏 Acknowledgments

  • Built with PyO3 for Python bindings
  • Uses nom for parsing
  • Inspired by lasio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

las_read_rs-0.1.7.tar.gz (20.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

las_read_rs-0.1.7-cp38-abi3-win_amd64.whl (733.1 kB view details)

Uploaded CPython 3.8+Windows x86-64

las_read_rs-0.1.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (910.0 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

las_read_rs-0.1.7-cp38-abi3-macosx_11_0_arm64.whl (848.1 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file las_read_rs-0.1.7.tar.gz.

File metadata

  • Download URL: las_read_rs-0.1.7.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for las_read_rs-0.1.7.tar.gz
Algorithm Hash digest
SHA256 0947772b480547d8f4f39a159b1c65770a85d519d32036c6dd77efe68576838e
MD5 422c417da0dc2799ce38e3ec1fb9257e
BLAKE2b-256 84ea4c93e38f5672adc885460d79e8355f1bbf84962ca96083d4dfbf5130604b

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.7.tar.gz:

Publisher: flujodetrabajo.yml on jemilianofl/lasio-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file las_read_rs-0.1.7-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: las_read_rs-0.1.7-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 733.1 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for las_read_rs-0.1.7-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 11a991be44d1b98a283f3add8cfb0fa4e4d94e48ea3ce598c8cb79cd0d642385
MD5 b18fa9796f423b08a99deb333f710b25
BLAKE2b-256 30b5a6cb26d9a6e9dbeb0cc030332881f4331c64f71a03086228c034b18313ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.7-cp38-abi3-win_amd64.whl:

Publisher: flujodetrabajo.yml on jemilianofl/lasio-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file las_read_rs-0.1.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for las_read_rs-0.1.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c506f92c62cf6342998e21115ab6692ccb5fbfae18cbafbe55ba087e628ed7d5
MD5 c24b260a5de34834f57c056aa198d626
BLAKE2b-256 5cd61e235a6e06f4e619d36e684c95095cfe02a737a26610b47b259f452b237a

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: flujodetrabajo.yml on jemilianofl/lasio-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file las_read_rs-0.1.7-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for las_read_rs-0.1.7-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89baaefe03f6ec27250a7091da6a7697d7b33331ff749aa5468839c546ef87fb
MD5 4ceddb68f33bc753a466ee04555726b6
BLAKE2b-256 24d13a70176fdc0ed4221457486e11416beb7006e0126d0f549eddc788e420ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.7-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: flujodetrabajo.yml on jemilianofl/lasio-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page