Skip to main content

laterite — a Rust-backed AGS4 reader, writer and validator

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.

ci python cov PyPI Python versions License: MIT

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

122 / 131 of python-ags4 1.2.0's own test suite passes through laterite.compat (the 9 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

laterite-0.7.0.tar.gz (850.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

laterite-0.7.0-cp312-abi3-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.12+Windows x86-64

laterite-0.7.0-cp312-abi3-manylinux2014_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.12+

laterite-0.7.0-cp312-abi3-macosx_11_0_arm64.whl (6.1 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file laterite-0.7.0.tar.gz.

File metadata

  • Download URL: laterite-0.7.0.tar.gz
  • Upload date:
  • Size: 850.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for laterite-0.7.0.tar.gz
Algorithm Hash digest
SHA256 5daff11923bf84b699812a166df793abf5b59f27aefd22800c1f5ab7c5a59db7
MD5 27f385bedcf4c998011b672ca5152265
BLAKE2b-256 37a05962bc8b1291cb1eb92fb1453e4beed443f5d1f8ffa6cb53baa1c4b61cb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for laterite-0.7.0.tar.gz:

Publisher: release.yml on niko86/laterite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file laterite-0.7.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: laterite-0.7.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for laterite-0.7.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6dfc04fad177aba1c9b2fb87bb0fd82496a19302fb9b2c6398720675e58ab6dd
MD5 b7f5d88d576b1e93373cc332fa95fae7
BLAKE2b-256 2cfb117f7a60cb476081d29e3db32e1dd87dd09b1c4e1ae61af1ac3523ec6d49

See more details on using hashes here.

Provenance

The following attestation bundles were made for laterite-0.7.0-cp312-abi3-win_amd64.whl:

Publisher: release.yml on niko86/laterite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file laterite-0.7.0-cp312-abi3-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for laterite-0.7.0-cp312-abi3-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d3443829517c64654e32673847eb6d30bca00f4b3c896b21411ce18b60dbe648
MD5 cf889ac8ecaf5e85931a63082703242e
BLAKE2b-256 15218d202aa2982381668f1ab723cbf35fab354656e396663b363aa5f9576655

See more details on using hashes here.

Provenance

The following attestation bundles were made for laterite-0.7.0-cp312-abi3-manylinux2014_x86_64.whl:

Publisher: release.yml on niko86/laterite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file laterite-0.7.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for laterite-0.7.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac729303ea995a43d0ad4d679f82d755d3bdfa799774d64933399c3751ad6aba
MD5 4fb690ef300436708c041d49f72dad0c
BLAKE2b-256 7794519a81857a7fd98e781a2d1edcd464fd00ee83e3bc0691b86961cd1570d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for laterite-0.7.0-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on niko86/laterite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.12.0

5 files

0.11.0

5 files

0.10.1

4 files

0.10.0

4 files

0.9.0

4 files

0.8.0

4 files

This release

0.7.0 This release

4 files

0.6.2

4 files

0.6.1

4 files

0.6.0

4 files

0.5.1

4 files

0.5.0

4 files

0.4.0

3 files

0.2.0

3 files

0.1.0

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page