read_lithology_codes

petrophys.io.read_lithology_codes

read_lithology_codes(
source,
*,
code_column=None,
label_column=None,
sheet_name=None,
sep=None,
)[source]

Read a codebook without confusing rock names with grouping columns.

CSV/TSV/Excel/DataFrames are supported. The code column is found under code, abbreviation, lithology code, lith code, facies code, id or value; the rock name under lithology, attribute, lithology attribute, rock, rock type, rock name, lith, facies, name, label or description (case, spaces and punctuation ignored), so Kingdom Abbreviation,Attribute tables read as they are. A table of two other columns is read as code, then name. Attribute takes precedence over Lithology Attribute; pass label_column explicitly to select a different grouping. Empty labels and duplicate codes are errors.