laterite¶
laterite reads, validates, queries and produces AGS4 geotechnical data. Files come back as
born-typed polars frames — the polars dtype is the AGS type — wired into a fluent, chainable
API. One engine drives Python, the lat CLI, Node and DuckDB, and it's a drop-in for
python-ags4, rebuilt on a Rust core for speed.
In one breath¶
import laterite
# Validate a file. read(...).validate() returns the Ags4File (so it chains);
# the Report is on the .report property.
ags = laterite.read("examples/sample_site.ags").validate()
r = ags.report
print(
f"is_valid={r.is_valid} count={r.count} "
f"dict_version={r.dict_version!r} resolution={r.resolution!r}"
)
assert r.is_valid is True
assert r.count == 0
assert r.dict_version == "4.1.1" # auto-selected from TRAN_AGS
read(...) gives you an Ags4File; .validate() runs the numbered-rules engine and hands the file
straight back so the chain keeps flowing, with the verdict on .report. The dictionary edition
(4.1.1) is picked automatically from the file's TRAN_AGS row — no flags, no guessing.
Tip
Every frame is born typed. A 2DP column is a polars Float64, a date is a Date, an ID is a
String — so .query(...), .sql(...) and plain polars all see real types, not text.
Where to go next¶
- New here? → Learn — install, then read → validate → query → produce, one step at a time.
- Need to get something done? → Cookbook — task-shaped recipes you can lift wholesale.
- Show me what it can do? → Chaining — the fluent API end to end, one chain at a time.
- Looking up a function? → Reference — the cheatsheet and the
latCLI.