Skip to content

Read a group at the shell

Available in: Python · Node · DuckDB · CLI · Browser

Dump one group's rows straight from a file — no engine run, no import. At the shell, lat read gives you the raw cells as a table, CSV, or JSON; omit the group to list the file's group codes.

lat read examples/sample_site.ags LOCA --csv
LOCA_ID,LOCA_TYPE,LOCA_NATE,LOCA_NATN,LOCA_GL,LOCA_FDEP
BH01,CP,451105.75,161993.25,23.68,26.20
BH02,RC,451235.21,161989.66,32.49,17.41
BH03,RC,451347.36,161993.80,28.54,29.48
BH04,RC,451469.88,161995.66,29.04,25.44
BH05,RC,450991.38,162109.98,31.62,24.14
BH06,CP,451134.92,162099.15,26.92,26.63
BH07,RC,451240.87,162124.13,31.33,10.25
BH08,CP,451371.12,162103.95,28.67,23.40
BH09,CP,451492.87,162121.36,30.98,16.77
BH10,CP,450988.85,162219.26,27.60,15.83
BH11,CP,451122.65,162211.90,23.64,11.56
BH12,RC,451230.71,162207.91,26.17,19.32
BH13,RC,451352.49,162232.70,26.32,28.95
BH14,RC,451492.80,162228.55,24.42,25.33

lat read <file> <GROUP> dumps the group's raw file cells — faithful to the bytes (26.20 stays 26.20, not 26.2). --csv and --json are byte-identical whether you run the native binary, uvx --from laterite lat, or npx laterite; the default --table is a human view. Omit <GROUP> to list the file's group codes, one per line.

import laterite

loca = laterite.read("delivery.ags").table("LOCA")   # a born-typed frame
print(loca)

The library hands you a born-typed frame — numeric columns are real numbers, the typed complement to the CLI's raw dump. lat read in the Python console-script mirrors the binary's raw output for --csv/--json; reach for the library table() when you want the typed frame. See Get a group as a typed frame.

See also: Get a typed frame · Filter & select