Cookbook¶
Task-indexed recipes. Each one is a runnable block you can lift straight into your code — the snippet on the page is the exact file the CI gate executes, so the output is real. New here? the Learn path walks the same ground in order; this page is for "how do I…?".
Reading & typing¶
- Get one group as a typed frame —
read(...)["LOCA"], born-typed. - Read XN columns as numeric — opt-in
xn="numeric"for the AGS numeric-or-text type. - Explore the registry & KEY chain —
child_groups/inherited_key_names.
Validating¶
- Validate a delivery — in Python and on the
latCLI (+ exit codes). - List the rules / report the edition —
list_rules()anddict_for().
Querying¶
- Filter & select one group — the lazy
.query().filter().select()builder. - SQL across groups —
.sql(...)joins on the shared keys. - Pull one borehole's record set —
.at(...)fan-out →.frames(). - Splice your own step (
.pipe) — drop a function into the chain.
Producing AGS4¶
- Build from frames —
build_ags4({code: frame}). - Build from a typed graph —
build_ags4(PROJ(...))(#214).
Repairing & comparing¶
- Fix a dirty file —
.fix()→ a new, repaired handle. - Diff two revisions — KEY-aware, type-aware.
- Certify a clean file — mint an
.ags.idxand skip re-validation.
Sharing & migrating¶
- Pack / encrypt for transport — zstd + optional age encryption.
- Drop-in for python-ags4 —
from laterite import compat as AGS4.
Tip
Want to see the whole fluent API assembled from these parts? The Chaining showcase
climbs a power ladder from a one-line read().validate() to raw SQL, your own functions, and the
certify fast-path.