laterite
A Rust-backed AGS4 toolchain for the AGS4 geotechnical data format — validate, read as typed data, query, build, fix, diff, certify, and convert ↔ Excel — with a modern, born-typed polars API.
Coming from python-ags4?
laterite is a faster, faithful drop-in for its AGS4 module — swap
from python_ags4 import AGS4 for from laterite import compat as AGS4, keep
your code — and a full toolchain beyond it.
Install
pip install laterite # base AGS4 (polars + duckdb, pyarrow-free)
pip install "laterite[compat]" # + pandas (python-ags4 drop-in)
Requires Python ≥ 3.12.
Use
import laterite
# Validate — errors + warnings by default (FYI is opt-in)
report = laterite.validate("delivery.ags")
report.is_valid
for rule, findings in report.by_rule().items():
print(rule, len(findings))
# Read born-typed columns: a 2DP heading is a float, a DT a datetime
ags = laterite.read("delivery.ags")
ags.groups # ['PROJ', 'LOCA', 'SAMP', …]
ags["LOCA"]["LOCA_GL"][0] # → 12.3 (a polars DataFrame per group)
# Repair a dirty file into a fresh handle, then keep working with it
fixed = ags.fix(risky=True) # pads short rows, transliterates non-ASCII, …
# Typed graph: PROJ → LOCA → SAMP → …
from laterite.ags4 import read_typed
proj = read_typed("delivery.ags")
for loca in proj.locas:
print(loca.loca_id, loca.loca_gl)
# python-ags4 drop-in — swap the import, keep your code
from laterite import compat as AGS4
tables, headings = AGS4.AGS4_to_dataframe("delivery.ags")
AGS4.dataframe_to_AGS4(tables, headings, "round-trip.ags")
The native API returns born-typed polars frames by default (or pandas
with read(..., backend="pandas")) — both pyarrow-free, read back from a
Python-owned in-memory DuckDB engine.
One engine, every stack
laterite on PyPI is the Python surface of one Rust AGS4 engine, shared
across:
| Surface | Package | Get it |
|---|---|---|
| Python | laterite — PyPI |
pip install laterite |
| Node.js | laterite — npm |
npm install laterite |
| Rust / CLI | lat |
GitHub Releases |
| DuckDB | laterite_ags4 — community extension |
INSTALL laterite_ags4 FROM community; |
| Browser | validator + data explorer — WASM | open in a browser |
More than a faster python-ags4
python-ags4 is the
reference Python library for AGS4 — validation plus pandas read/write.
laterite is a faithful, faster drop-in for that, and a cross-surface toolchain
on top:
laterite |
python-ags4 |
|
|---|---|---|
| Runs on | Python · Node · CLI · DuckDB · browser | Python |
| Validate — numbered AGS4 rules | ✅ | ✅ |
| Read → typed data | ✅ born-typed (polars) | pandas (all strings) |
| Build / write · Excel ↔ AGS4 | ✅ | ✅ |
Repair engine (fix) · revision diff · .ags.idx certificates |
✅ | — |
| SQL across groups (DuckDB) · zstd+age transport · typed graph | ✅ | — |
And faster: validation agrees on the same findings but runs ~17× on a 512 KB file, ~8× from 50 MB to 1 GB (a 557 MB file in ~6.5 s vs ~53 s) — full tables + methodology in the repo README.
Parity + clean-room
121 / 131 of python-ags4 1.2.0's own test suite passes through
laterite.compat (the 10 remaining are deliberate non-closures). The validator
is clean-room from the AGS4 spec — python-ags4 is LGPL-3.0, and the
separation is what lets laterite ship under MIT. Details:
COMPAT.md ·
OBSERVATIONS.md.
Docs
Full documentation — Learn, Cookbook, Concepts, and the Python API reference — at https://niko86.github.io/laterite/docs/.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file laterite-0.8.0.tar.gz.
File metadata
- Download URL: laterite-0.8.0.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62c25a5d9df4fa24bd6b6d71e8181048031b017505091a43e790c2c72f1fbbba
|
|
| MD5 |
0cb8be5bf1f835049fefde496a16c4e8
|
|
| BLAKE2b-256 |
d72e29d790a52fb945d26e31a1fb5e056bf9025fd0bdd8dcee116eeb87cd8a6a
|
Provenance
The following attestation bundles were made for laterite-0.8.0.tar.gz:
Publisher:
release.yml on niko86/laterite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laterite-0.8.0.tar.gz -
Subject digest:
62c25a5d9df4fa24bd6b6d71e8181048031b017505091a43e790c2c72f1fbbba - Sigstore transparency entry: 2277108656
- Sigstore integration time:
-
Permalink:
niko86/laterite@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/niko86
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file laterite-0.8.0-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: laterite-0.8.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 7.2 MB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f116fb12269c8ec8851fe10ed5428f3ae2f444e69a09d763588886a9fbefd0ef
|
|
| MD5 |
e85eccbead1129b83219a47e0738bce1
|
|
| BLAKE2b-256 |
28c83a4c1e8fa4d4041392e5c7ee52d3b94806a00600784906ede0d9edbf645e
|
Provenance
The following attestation bundles were made for laterite-0.8.0-cp312-abi3-win_amd64.whl:
Publisher:
release.yml on niko86/laterite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laterite-0.8.0-cp312-abi3-win_amd64.whl -
Subject digest:
f116fb12269c8ec8851fe10ed5428f3ae2f444e69a09d763588886a9fbefd0ef - Sigstore transparency entry: 2277109221
- Sigstore integration time:
-
Permalink:
niko86/laterite@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/niko86
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file laterite-0.8.0-cp312-abi3-manylinux2014_x86_64.whl.
File metadata
- Download URL: laterite-0.8.0-cp312-abi3-manylinux2014_x86_64.whl
- Upload date:
- Size: 7.1 MB
- Tags: CPython 3.12+
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02bdf977389fcb60f32b21b66d62782df016ab647733aeaf681846567839b831
|
|
| MD5 |
165a7d21c6020c9a1b8729ed9e35913d
|
|
| BLAKE2b-256 |
169c922b81bfc47e746d27f3260dafc3952250085d308cbf3fcae239b4fbb8b3
|
Provenance
The following attestation bundles were made for laterite-0.8.0-cp312-abi3-manylinux2014_x86_64.whl:
Publisher:
release.yml on niko86/laterite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laterite-0.8.0-cp312-abi3-manylinux2014_x86_64.whl -
Subject digest:
02bdf977389fcb60f32b21b66d62782df016ab647733aeaf681846567839b831 - Sigstore transparency entry: 2277109417
- Sigstore integration time:
-
Permalink:
niko86/laterite@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/niko86
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file laterite-0.8.0-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: laterite-0.8.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 6.3 MB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b39df4a12fd5ca1848b4ecb374eff84e635141fa76afeebd35cd67e70c1a9eee
|
|
| MD5 |
ef6f18cdcacba67d727e3f52a96d2abb
|
|
| BLAKE2b-256 |
9c217d1d98d47f549361b82f991d8b4cd3138e767382b372b933744b04727b97
|
Provenance
The following attestation bundles were made for laterite-0.8.0-cp312-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on niko86/laterite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laterite-0.8.0-cp312-abi3-macosx_11_0_arm64.whl -
Subject digest:
b39df4a12fd5ca1848b4ecb374eff84e635141fa76afeebd35cd67e70c1a9eee - Sigstore transparency entry: 2277108904
- Sigstore integration time:
-
Permalink:
niko86/laterite@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/niko86
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a86960a3fe42b7fad2732d7b61fcde452e2952cf -
Trigger Event:
push
-
Statement type: