Extract geotechnical data from PDF reports and output DIGGS XML
Project description
Geotech Report Extraction
Extract geotechnical borehole data from PDF reports or Azure Document Intelligence JSON exports and output DIGGS 2.6 XML.
Features
- Parse borehole logs from geotechnical reports (Langan, Schnabel, and generic formats)
- Extract soil layers, SPT blow counts, groundwater levels, and lab test results
- Azure Document Intelligence (DI) JSON input for cloud/serverless workflows
- Palantir Foundry integration with ready-to-use Spark transforms
- XGBoost page classifier for automatic boring log identification
- Template-based appendix cover page detection and report structure analysis
- Optional vision-based extraction using Anthropic Claude or GPT-4o via Palantir Funhouse
- Output DIGGS 2.6 XML for interoperability
- Geospatial utilities for coordinate conversion and boring location mapping
Installation
pip install geotech-report-extraction
Core dependencies include XGBoost, scikit-learn, and pandas for ML-based page classification.
Optional extras
# PDF parsing (PyMuPDF)
pip install geotech-report-extraction[pdf]
# OCR support (Tesseract)
pip install geotech-report-extraction[ocr]
# Vision LLM extraction (Anthropic Claude)
pip install geotech-report-extraction[vision]
# Geospatial utilities (coordinate conversion, mapping)
pip install geotech-report-extraction[geo]
# Everything
pip install geotech-report-extraction[all]
Quick Start
From PDF
from geotech_report_extraction import extract_report
result = extract_report("report.pdf")
# With vision LLM
result = extract_report("report.pdf", use_vision=True, vision_api_key="sk-...")
From Azure Document Intelligence JSON
from geotech_report_extraction.di_reader import extract_from_di_json
result = extract_from_di_json("report_di.json")
# Or with a pre-parsed dict
result = extract_from_di_json(di_data_dict, file_label="my_report")
Palantir Foundry
See foundry_transforms/boring_log_pipeline.py for a three-stage Spark pipeline:
- Flatten raw DI JSON files into a per-page tabular dataset
- Identify boring log pages and group by boring ID
- Extract samples, soil layers, and water levels per boring
Report Structure Analysis
After page classification, the appendix cover page analyzer identifies report structure:
from geotech_report_extraction.report_structure import analyze_report_structure
# pages: list of dicts with 'text' and 'predicted_class' keys
structure = analyze_report_structure(pages)
for section in structure.sections:
print(f"Appendix {section.letter}: {section.title} ({section.appendix_type})")
print(f" Pages {section.start_page}–{section.end_page}")
The analyzer builds a per-report template from classifier-predicted covers, then uses it to confirm predictions and find missed covers. Works across firm formats (Schnabel structured headers, Langan minimal covers).
CLI
geotech-extract report.pdf -o output.xml
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 geotech_report_extraction-0.5.4.tar.gz.
File metadata
- Download URL: geotech_report_extraction-0.5.4.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edd042a2ab0ce9d871b20ec8f70c2f5540c0f19cc2e9428041362c4abfca330d
|
|
| MD5 |
3cfdaa3f65332b030537ed253a7106ab
|
|
| BLAKE2b-256 |
86ec09f100a67bbbd569a54b1dab33ccb49130af65c29d8fd15cbe27be017c10
|
File details
Details for the file geotech_report_extraction-0.5.4-py3-none-any.whl.
File metadata
- Download URL: geotech_report_extraction-0.5.4-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed3822e685dea88b90baee3d674438d4feab4b28a63806a4e4ac8c9b8156063c
|
|
| MD5 |
f9920620500abe6f07fcad6bf9206cd3
|
|
| BLAKE2b-256 |
ea695a85de7d25dcd8fa9dd201453ba237d15358c84d6c6d6cbfb54f0a7c3c3a
|