pyDIGGS¶
A Python package for Data Interchange for Geotechnical and Geoenvironmental Specialists (DIGGS).
- Licensed under the Apache License 2.0
- Documentation: https://xinp-hub.github.io/pydiggs
- GitHub: https://github.com/xinp-hub/pydiggs
Features¶
- Validate DIGGS instance files against:
- DIGGS XSD Schema (2.5.a, 2.6, 3.0.0) with namespace auto-detect (default profile 3.0.0 when the namespace is unknown)
- DIGGS Standard dictionaries / codeSpace semantics (offline)
- Schematron business rules (bundled DIGGS lxml-adapted rules by default)
- Lightweight context checks
- Flexible validation output (log files or console)
- Command-line interface (CLI)
Web Application¶
Not a Python user? Looking for leveraging the power of pyDIGGS in a modern web application? Check out:
Quick Start¶
Install pydiggs (requires Python 3.11+):
Basic usage with Python:
from pydiggs import detect_diggs_version, validator
# Profile auto-detected from namespace (unknown → 3.0.0)
validation = validator("path/to/your/diggs_file.xml")
print(detect_diggs_version("path/to/your/diggs_file.xml")) # "2.5.a", "2.6", or "3.0.0"
# Pin a profile (Python API only)
validation = validator("path/to/your/diggs_file.xml", diggs_version="2.6")
validation.schema_check()
validation.dictionary_check()
validation.schematron_check()
validation.context_check()
Basic usage with CLI:
pydiggs schema_check "path/to/your/diggs_file.xml"
pydiggs dictionary_check "path/to/your/diggs_file.xml"
pydiggs schematron_check "path/to/your/diggs_file.xml"
pydiggs context_check "path/to/your/diggs_file.xml"
See Usage for overrides, log options, and known limits.
For more detailed information and advanced usage, please see the Usage guide.