Registry / data / lasio
library0.32pypypi✓ verified 83d ago

The `lasio` library (version 0.32) provides robust tools for reading and writing well data from Log ASCII Standard (LAS) files, supporting both LAS 1.2 and 2.0 specifications. It is actively maintained with regular updates for bug fixes and feature enhancements, typically releasing new minor versions a few times a year.

pip install lasio
INSTALL
IMPORT
SIG · LASIO
L
lasio
datapythonv0.32
Install
3.8s avg
Import
408ms
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.32 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.406s · 89.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.8s · import 0.410s · 86MB
89MB installed
● package 89MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

read
from lasio import read
import lasio
LASFile
from lasio import LASFile
import lasio
CurveItem
from lasio import CurveItem
import lasio

This quickstart demonstrates how to read a LAS file (simulated from a string for simplicity) using `lasio.read()`, access well header information, retrieve curve data, and convert the data into a Pandas DataFrame.

import lasio import io # Simulate a LAS file content for demonstration las_content = """~VERSION VERS. 2.00: LAS Version WRAP. NO: No line wrapping ~WELL STRT.M 10.00: START DEPTH STOP.M 20.00: STOP DEPTH STEP.M 0.50: STEP NULL. -999.25: NULL VALUE WELL. EXAMPLE WELL: WELL COMP. EXAMPLE CO: COMPANY ~CURVE DEPT.M : Depth GR.API : Gamma Ray NEUT.V/V : Neutron ~A DEPT GR NEUT 10.000 100.0 0.300 10.500 105.0 0.310 11.000 110.0 0.320 11.500 112.0 0.315 12.000 115.0 0.325 """ # Read the LAS file from a string (or from a path: lasio.read('path/to/file.las')) las_file_obj = io.StringIO(las_content) l = lasio.read(las_file_obj) # Access well information print(f"Well Name: {l.well.WELL.value}") print(f"Company: {l.well.COMP.value}") # Access curve data print(f"Gamma Ray Curve (first 3 values): {l['GR'][:3].tolist()}") print(f"Depth Curve (last 2 values): {l['DEPT'][-2:].tolist()}") # Convert to Pandas DataFrame df = l.df() print("\nDataFrame head:") print(df.head())
Debug
Known issues
gotchaLAS files frequently use non-standard encodings (e.g., 'latin-1', 'cp1252') that can cause `UnicodeDecodeError` if not specified. The default encoding for `lasio.read` is 'utf-8'.
fix
Explicitly pass the correct encoding to `lasio.read()`. Common alternatives are `encoding='latin-1'` or `encoding='cp1252'` based on the file's origin.
affects: all
breakingVersion 0.20.0 introduced a significant refactor in how curve definitions and curve data are handled, using more explicit `CurveItem` objects. Direct access patterns used in older versions might break.
fix
Review the 0.20.0 release notes. Ensure you are accessing curve metadata via `l.curves[idx].mnemonic`, `l.curves[idx].unit`, `l.curves[idx].value` and data via `l[mnemonic]` for consistency. Avoid direct mutation of `l.curves` lists if you previously did so.
affects: <0.20.0
gotchaWhen working with `lasio` data, remember to account for the `NULL` value defined in the LAS file header. `lasio` converts this value to `numpy.nan` by default.
fix
Filter or impute `numpy.nan` values in your analysis, for example: `data_clean = l['GR'][~numpy.isnan(l['GR'])]` to remove NaNs before processing.
affects: all
Upgrade
Version history
0.32latest on PyPI · released Aug 1, 2025
Audit
Dependencies
numpyrequiredCore dependency for numerical data handling.
pandasrequiredCore dependency for data frame operations and internal data structures.
Agent activity
8 hits · last 30 days
node
8
Resources
lasio — pip install lasio · libregistry