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.6.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.6-cp38-abi3-win_amd64.whl (733.0 kB view details)

Uploaded CPython 3.8+Windows x86-64

las_read_rs-0.1.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (909.2 kB view details)

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

las_read_rs-0.1.6-cp38-abi3-macosx_11_0_arm64.whl (848.5 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: las_read_rs-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 f453ffd80421fcee0f1e4d1fddf006b02febd1456e26868da42e0d1b14adb9e8
MD5 8a233a0919f70154e4ffb105b34d03cd
BLAKE2b-256 0658f5b92462bde95dd3888952779c4829fbd11bbbe9cd351723d53ac961020a

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.6.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.6-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: las_read_rs-0.1.6-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 733.0 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.6-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 965dada30e5240d51f402f0a4b7cb8e5b05c68a68bbfa278ba2d8093121a7996
MD5 a52e979bf3015fc8b5656b68c3efb27e
BLAKE2b-256 9250837d7422555e5b17964fd005aed5d55bfd2ddc4733f9999b8dcf74bd04a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.6-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.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for las_read_rs-0.1.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7cab5b44ee9e41fd0f908f2cbd437903b36b452545a9e64f92c6e53aa976046d
MD5 f4448b656c05fe81728bb1e710d99d7e
BLAKE2b-256 a0aa0bd17af01042083e82dfd4a44661ca5ce999fb9257aea854b0360855ec86

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.6-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.6-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for las_read_rs-0.1.6-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ce3119bc1a1aa254ca015c0f9540467cde9519973a5b970fb48ad6c24aa791c
MD5 c9c33e15b5f6429d3f2d21c717b57596
BLAKE2b-256 0c4db19daccb020b54d92097a09ffb0c435680ff4adeef6557b6745022f0aa7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for las_read_rs-0.1.6-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