laterite-quarry
quarry pulls public AGS4 geotechnical datasets into a local mirror, keeps
their licence with them, and stays out of the way of the sites it reads.
laterite-forge makes synthetic AGS4 data. Quarry digs up the real thing. Both feed laterite, which reads and validates it.
Status: early release. Commands may still change between 0.x versions.
Install with uv
Run it once, with nothing installed:
uvx --from "laterite-quarry[rvo]" quarry rvo list
Install the quarry command for good:
uv tool install "laterite-quarry[rvo]"
quarry doctor
Or add it to a uv project, to use the mirror from Python:
uv add "laterite-quarry[rvo]"
The [rvo] extra adds .7z support, which the RVO archives need. Leave it
off if you only want BGS data. With pip: pip install "laterite-quarry[rvo]".
Sources
| Source | What | How it is reached |
|---|---|---|
bgs |
British Geological Survey AGS exports, by area | The BGS AGS export API |
rvo |
Dutch offshore wind site investigations (Fugro) | A hand-curated list of direct file links |
Use
quarry bgs count --bbox -0.133,51.514,-0.127,51.518
quarry bgs pull tcr --bbox -0.133,51.514,-0.127,51.518 --dry-run
quarry bgs pull tcr --bbox -0.133,51.514,-0.127,51.518
quarry rvo list
quarry rvo pull hkz-wfs3-bh # needs the [rvo] extra for .7z
quarry list
quarry holes bgs/tcr # one row per borehole: ID, type, depth, groups, project
quarry check bgs/tcr # validate with laterite
quarry cite bgs/tcr # licence and attribution line
--bbox is west,south,east,north in decimal degrees. Add --json for a
provenance envelope (meta.source is live or local), or --agent for the
same in compact form.
How the files are laid out
--files on a pull chooses what lands in the mirror:
--files |
What you get |
|---|---|
as-sent (default) |
Every file exactly as the source supplied it. BGS: a file per project per cell. RVO: a file per borehole. |
per-project |
One AGS4 file per project in projects/, merged with laterite. Rows are matched by their KEY headings, so a borehole supplied twice lands once. |
archives (BGS only) |
The downloaded zips, unopened. |
A merged file is written by laterite, so it is not byte-for-byte what the source sent, though no value is changed. A project that will not merge cleanly is kept as sent and named in the pull's output.
From Python
import laterite
from laterite_quarry import cli, store
cli.main(["rvo", "pull", "hkz-wfs3-bh"]) # one download, then cached
folder = store.dataset_dir("rvo", "hkz-wfs3-bh")
for path in sorted(folder.glob("*.AGS")):
print(path.name, laterite.read(path).groups)
Save that as holes.py and run it without setting anything up:
uv run --with "laterite-quarry[rvo]" holes.py
Being a good citizen
Neither site publishes a rate limit. BGS's service code has no rate limiter,
only its cap of 50 boreholes per export; neither site sends rate-limit headers,
and neither robots.txt sets a crawl delay. BGS's terms forbid anything
resembling a denial-of-service attack. So this tool sets its own limit, and
enforces it in one place (http.py):
- One request at a time, at least 2 seconds apart per host.
--intervalcan raise the gap; it cannot go below 1 second. - The gap holds between runs too: the time of the last request to each host is
kept in the mirror, so a script calling
quarryin a loop is still spaced. - A server's
Retry-Afteris honoured, and failures back off: 4, 8, then 16 seconds, then a clean failure. - A request budget per run (
--budget, 40 by default); exceeding it stops the run. - Nothing is fetched twice: a mirrored dataset is reused unless
--refresh. - A pull counts first and refuses an area over
--max-holes. - A User-Agent naming this tool and this repository.
- Only https requests to the two known hosts are made; anything else is refused, including a redirect that leads elsewhere.
- Responses and unpacked archives are size-capped, and a pull replaces the mirror only once it has finished.
- RVO's
robots.txtdisallows/search, so the tool never searches or crawls that site. It fetches only links inrvo_catalogue.json. - Whatever a run drops (cells it could not split, archive members it refused, files it did not check) is reported in its output.
Licences
This code is MIT. The data is not ours: each mirrored dataset records its own
licence and attribution, and quarry cite prints them. No data files are
distributed in this repository.
- BGS exports state the Open Government Licence v3.0 in the metadata file inside each download.
- RVO states CC0 1.0 for its site content unless a document says otherwise.
Exit codes
0 ok · 1 findings (check) · 2 usage error · 3 not found, or a file
could not be read or written · 4 check met a file it could not read as
AGS4 · 5 pull refused by its size cap, or a missing optional dependency ·
7 upstream failure, request budget spent, or a request or archive this tool
refused.
Known limits
- A dataset name is 1-64 characters of
a-z,0-9,-and_. - A BGS area over the export limit is fetched as several cells, so one project
can arrive as a file per cell.
quarry holesis the joined-up view: it lists each borehole once, by BGS's own identifier (BGS_LOCA_ID). A borehole that comes back in two cells is marked as a second copy, and a file holding nothing but second copies is removed. Files are otherwise kept exactly as BGS sent them.
Developing
uv sync
uv run ruff check . && uv run ruff format --check . && uv run ty check && uv run pytest -q
The tests never touch the network.
To release: bump version in pyproject.toml, date the changelog entry,
merge to main, then run the Release workflow from the Actions tab. It
publishes to PyPI and then tags the commit.
Metadata
Release files for laterite-quarry 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| laterite_quarry-0.1.0.tar.gz | 72.6 kB | With provenance | Details for laterite_quarry-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| laterite_quarry-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for laterite_quarry-0.1.0-py3-none-any.whl |
Total release size: 97.0 kB
Release files / laterite_quarry-0.1.0.tar.gz
| Download URL | laterite_quarry-0.1.0.tar.gz |
|---|---|
| Size | 72.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82c2307e8ee7589747aed881056d43cb520db23c425769f46a03801e5b89ca56
|
|
BLAKE2b-256 checksum How to use checksums |
d5dbcad34393825f7cd5f3baf1f3cc0211f777186e5137de50be86b6e6422d76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / laterite_quarry-0.1.0-py3-none-any.whl
| Download URL | laterite_quarry-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7252fd388b6f91b12f023afba328ba71cc974264023b48a510a6fedd9378f8af
|
|
BLAKE2b-256 checksum How to use checksums |
8e651a98d4a55b56f69fb0dc0b179bc0b4ca25bfd6799555f2418a14b96c122f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for laterite-quarry 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for laterite_quarry-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.