mcpField
S
striplog

striplog

github.com/steadfastasartData & databases7363 installsUpdated 6w ago
Repository

About striplog

striplog is a Python library for representing lithology and other geological data as depth intervals. It supports querying, statistics, plotting, and exporting structured logs for geology and well-log workflows.

Key features

  1. 01Build logs from CSV or text
  2. 02Query and crop depth intervals
  3. 03Calculate net-to-gross statistics
  4. 04Plot and correlate well logs
  5. 05Export to CSV, LAS, and JSON

Use cases

  1. 01Creating lithology logs from well data
  2. 02Comparing intervals across wells
  3. 03Calculating lithology proportions
  4. 04Exporting logs for downstream analysis

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/steadfastasart/geoscience-skills --skill striplog

After installing, type/striplogin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
components.md
lexicon.md
scripts/
create_striplog.py

Details

From the project README

striplog - Lithological Logs

Quick Reference

from striplog import Striplog, Interval, Component

# Create from intervals
intervals = [
    Interval(top=0, base=10, components=[Component({'lithology': 'sandstone'})]),
    Interval(top=10, base=25, components=[Component({'lithology': 'shale'})]),
    Interval(top=25, base=40, components=[Component({'lithology': 'limestone'})]),
]
strip = Striplog(intervals)

# Load from file
strip = Striplog.from_csv('lithology.csv')  # Columns: top, base, lithology

# Access and display
print(strip)
strip.plot()
df = strip.to_dataframe()

Key Classes

ClassPurpose
StriplogMain log container - holds intervals
IntervalDepth interval with top, base, and components
ComponentRock type definition with properties
LexiconRock type dictionary with synonyms
LegendVisualization styles (colors, patterns)

Essential Operations

Create from CSV
# CSV format: top,base,lithology
strip = Striplog.from_csv('lithology.csv')
strip.plot()
Create from Description Text
from striplog import Striplog, Lexicon

description = """
0.0 - 5.5 m: Fine to medium sandstone
5.5 - 12.0 m: Grey shale with silt laminations
12.0 - 18.5 m: Massive limestone, fossiliferous
"""
strip = Striplog.from_description(description, lexicon=lexicon)
Query and Extract
# Get interval at depth
interval = strip.read_at(z=15)
print(interval.primary.lithology)

# Crop to depth range
subset = strip.crop((10, 30))

# Unique lithologies
lithologies = strip.unique('lithology')
Statistics
# Net-to-gross for specific lithology
ntg = strip.net_to_gross(pattern={'lithology': 'sandstone'})
print(f"Sandstone: {ntg * 100:.1f}%")

# Merge adjacent same-lithology intervals
merged = strip.merge_neighbours()
Well Correlation
import matplotlib.pyplot as plt

wells = [Striplog.from_csv(f'well{i}.csv') for i in range(1, 4)]
fig, axes = plt.subplots(1, 3, figsize=(10, 8), sharey=True)

for ax, well, name in zip(axes, wells, ['Well 1', 'Well 2', 'Well 3']):
    well.plot(ax=ax, legend=legend)
    ax.set_title(name)

plt.tight_layout()
plt.savefig('correlation.png')
Export
strip.to_csv('output.csv')
strip.to_las('output.las')
strip.to_json('output.json')
df = strip.to_dataframe()

Hatch Patterns

PatternCodeTypical Use
Dots...Sandstone
Dashes---Shale
Plus+++Limestone
XxxxDolomite
VvvvVolcanic

When to Use vs Alternatives

ToolBest For
striplogStructured lithology logs, interval-based data, NTG, correlation
wellyWell log curves (continuous data), multi-well projects
custom matplotlibSimple one-off stratigraphic columns without interval logic

Use striplog when you need to represent geological intervals (lithology, facies) as structured objects with querying, statistics, and correlation.

Use welly instead when working with continuous well log curves (GR, RHOB). Welly and striplog complement each other -- welly for curves, striplog for lithology intervals.

Use custom matplotlib instead for simple, one-off stratigraphic columns where you don't need interval querying or net-to-gross calculations.

Common Workflows

Create lithological log from CSV data
- [ ] Prepare CSV with columns: top, base, lithology (optionally color)
- [ ] Load with `Striplog.from_csv('lithology.csv')`
- [ ] Define Legend with colors and hatch patterns for each lithology
- [ ] Verify intervals: check for gaps or overlaps
- [ ] Merge adjacent same-lithology intervals with `merge_neighbours()`
- [ ] Compute statistics: `net_to_gross()`, `unique()`
- [ ] Plot with legend and export to desired format

Common Issues

IssueSolution
Text not parsingDefine a Lexicon with synonyms
Wrong colorsCreate custom Legend with Decor objects
Gaps in logCheck interval top/base values match
Plot looks wrongVerify depth direction (increasing down)

References

Scripts

Comments

Markdown supported