Metadata-Version: 2.4
Name: laterite
Version: 0.4.0
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Dist: polars>=1.40.1
Requires-Dist: duckdb>=1.4.0
Requires-Dist: laterite-ags5>=0.4.0 ; extra == 'ags5'
Requires-Dist: pandas<3 ; extra == 'all'
Requires-Dist: pyarrow>=24.0.0 ; extra == 'all'
Requires-Dist: laterite-ags5>=0.4.0 ; extra == 'all'
Requires-Dist: pandas<3 ; extra == 'compat'
Requires-Dist: pandas<3 ; extra == 'pandas'
Requires-Dist: pyarrow>=24.0.0 ; extra == 'pyarrow'
Provides-Extra: ags5
Provides-Extra: all
Provides-Extra: compat
Provides-Extra: pandas
Provides-Extra: pyarrow
License-File: LICENSE
Summary: Rust-backed AGS4 reader/writer/validator — a fast, drop-in replacement for python-ags4 with a narwhals-native API
Keywords: ags,ags4,geotechnical,ground-investigation,validator,parser,rust,polars,narwhals
Author-email: niko86 <me@niko86.com>
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/niko86/laterite/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/niko86/laterite
Project-URL: Issues, https://github.com/niko86/laterite/issues
Project-URL: Repository, https://github.com/niko86/laterite

<p align="center">
  <img src="https://raw.githubusercontent.com/niko86/laterite/main/assets/laterite-social-preview-white.png" alt="laterite — a Rust-backed AGS4 reader, writer and validator" width="600" />
</p>

# laterite

A Rust-backed AGS4 reader, writer and validator for Python.

A faster drop-in for
[`python-ags4`](https://gitlab.com/ags-data-format-wg/ags-python-library)'s
`AGS4` module (1.2.0 parity-pinned, 122/131 tests) — swap
`from python_ags4 import AGS4` for `from laterite import compat as AGS4`.
Native API returns
[narwhals](https://narwhals-api.readthedocs.io/) frames over Polars,
so you can target polars / pandas / pyarrow without laterite picking
for you.

[![ci](https://github.com/niko86/laterite/actions/workflows/ci.yml/badge.svg)](https://github.com/niko86/laterite/actions/workflows/ci.yml)
[![rust cov](https://img.shields.io/codecov/c/github/niko86/laterite?flag=rust&label=rust%20cov)](https://codecov.io/gh/niko86/laterite)
[![python cov](https://img.shields.io/codecov/c/github/niko86/laterite?flag=python&label=python%20cov)](https://codecov.io/gh/niko86/laterite)
[![web cov](https://img.shields.io/codecov/c/github/niko86/laterite?flag=web&label=web%20cov)](https://codecov.io/gh/niko86/laterite)
[![PyPI](https://img.shields.io/pypi/v/laterite.svg)](https://pypi.org/project/laterite/)
[![Python versions](https://img.shields.io/pypi/pyversions/laterite.svg)](https://pypi.org/project/laterite/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

```bash
pip install laterite                  # base AGS4 (polars + narwhals)
pip install "laterite[compat]"        # + pandas (python-ags4 drop-in)
pip install "laterite[ags5]"          # + experimental .ags5db surface
```

```python
import laterite

result = laterite.validate("delivery.ags")
for rule, findings in result.by_rule().items():
    print(rule, len(findings))

# python-ags4 drop-in
from laterite import compat as AGS4
tables, _ = AGS4.AGS4_to_dataframe("delivery.ags")

# Or a typed view of the file
from laterite.ags4 import read_typed
proj = read_typed("delivery.ags")
```

The validator engine is clean-room from the AGS4 spec. python-ags4
is LGPL-3.0; the clean-room separation lets laterite ship under MIT.

Requires Python ≥ 3.12.

Full docs, parity catalogue and observations at
<https://github.com/niko86/laterite>.

