Skip to content

pyDIGGS

Validate DIGGS geotechnical and geoenvironmental XML offline: schema, dictionaries, Schematron business rules and context checks, with findings you can read, script against or feed to code-scanning tools.

Get started Install

pip install pydiggs
pydiggs validate BH-01.xml

Choose your path

  • Check files from the command line


    One command runs every check on a file or a whole folder, as text, JSON or SARIF.

    Quickstart

  • Validate in Python


    validate() for files and validate_bytes() for uploads return a Report of findings with stable rule ids, lines and XPaths.

    Findings

  • Run it as a web service


    An HTTP API with OpenAPI 3.1, or a hardened, attested container image.

    HTTP API

  • Embed it in a desktop app


    A stdio JSON-RPC sidecar any host language can drive: Electron, Tauri, .NET, Java, Rust and more.

    Stdio sidecar

  • Connect an AI assistant


    An MCP server with read-only validation and rule tools.

    MCP server

  • Keep files on the user's machine


    Run pyDIGGS in a web page with Pyodide: the document never leaves the browser.

    Browser

Not sure which fits? Compare the integrations.

What gets checked

Step What it checks
Structure Well-formed XML with a Diggs root and one DocumentInformation
Schema The bundled DIGGS XSD for 2.5.a, 2.6 or 3.0.0, picked from the file's namespace (unknown namespaces use 3.0.0)
Dictionary codeSpace values and units against the DIGGS Standard dictionaries from diggsml.org/def, offline
Schematron DIGGS business rules from DIGGSml/validation, adapted to run offline
Geometry srsName and srsDimension on each geometry object
Deprecation Anything the DIGGS schema marks as deprecated
Context In-document xlink:href targets and dataBlock arity

Everything runs offline by default: no file leaves your machine and pyDIGGS never contacts a server. The only other files a DIGGS file can make it read are local dictionaries its codeSpace values name inside the file's own folder; turn that off with --local-dictionaries off or validate(..., local_dictionaries="off"). See Validation checks for each step and its known limits.

Prefer a web application?

DXplorer brings pyDIGGS validation to the browser without any Python.

Stay updated

Hear about each feature release by GitHub notification, feed or email: see Stay updated.