Skip to main content

Soil extension for OWI-metadatabase SDK

Project description

OWI-metadatabase Soil Extension

version python versions license pytest lint issues DOI Coverage Documentation

Soil extension package for the OWI-metadatabase namespace SDK.

This package extends owi-metadatabase with soil-focused endpoints, data processing, and plotting helpers while keeping the same owi.metadatabase.* import namespace.

📚 Read the Documentation

Features

  • Soil API Client: Access soil profiles, in-situ tests, geotechnical samples, and lab tests
  • Processing Utilities: Convert API payloads to tabular/analysis-ready structures
  • Groundhog Integration: Convert CPT/profile data into Groundhog-compatible objects
  • Visualization Helpers: Build interactive Plotly maps and profile/fence plots
  • Namespace Extension: Works seamlessly with the core owi-metadatabase package

Installation

Install as extension package (owi-metadatabase-soil)

From TestPyPI (current deployment target):

pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple owi-metadatabase-soil

Using uv:

uv pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple owi-metadatabase-soil

Install from core package extra (owi-metadatabase[soil])

If you prefer installing from the base package extras:

pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple "owi-metadatabase[soil]"

Using uv:

uv pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple "owi-metadatabase[soil]"

Quick Start

from owi.metadatabase.soil import SoilAPI

soil_api = SoilAPI(token="your-api-token")
print(soil_api.ping())

Examples

1) Retrieve test locations

from owi.metadatabase.soil import SoilAPI

soil_api = SoilAPI(token="your-api-token")
result = soil_api.get_testlocations(projectsite="Nobelwind")

if result["exists"]:
    print(result["data"].head())

2) Find the closest in-situ test

closest = soil_api.get_closest_insitutest(latitude=51.707765, longitude=2.798876, radius=1.0)
print(closest["title"], f"at {closest['offset [m]']:.1f} m")

3) Retrieve CPT detail and optional Groundhog CPT object

cpt = soil_api.get_cpttest_detail(
    insitutest="BH-CPT-01",
    projectsite="Nobelwind",
    location="NW-A01",
    cpt=True,
)

print(cpt["exists"])
print(cpt["rawdata"].columns)

4) Retrieve a soil profile detail

profile = soil_api.get_soilprofile_detail(
    projectsite="Nobelwind",
    location="NW-A01",
    soilprofile="BH-Profile-01",
)

print(profile["exists"])

5) Plot test locations

from owi.metadatabase.soil import SoilPlot

plotter = SoilPlot(soil_api)
figure = plotter.plot_testlocations(return_fig=True, projectsite="Nobelwind")
figure.show()

Development

uv sync --dev
uv run invoke test.run
uv run invoke qa.all
uv run invoke docs.build

Built with ❤️ and 🧠 by OWI-Lab

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

owi_metadatabase_soil-0.1.0.tar.gz (957.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

owi_metadatabase_soil-0.1.0-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

File details

Details for the file owi_metadatabase_soil-0.1.0.tar.gz.

File metadata

  • Download URL: owi_metadatabase_soil-0.1.0.tar.gz
  • Upload date:
  • Size: 957.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for owi_metadatabase_soil-0.1.0.tar.gz
Algorithm Hash digest
SHA256 30c4e0a4b12c0c17ef17bc545044c20688528db2b105f492365d7efb658b7c97
MD5 890c77b04ce7082912508c6bd7ca51ec
BLAKE2b-256 52b3bedfee2d58405b8e0184c2e033b84b082be5682d99a8140806eb39a43898

See more details on using hashes here.

Provenance

The following attestation bundles were made for owi_metadatabase_soil-0.1.0.tar.gz:

Publisher: publish.yml on OWI-Lab/owi-metadatabase-soil-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file owi_metadatabase_soil-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for owi_metadatabase_soil-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faf19318089518988e03f30f770be8ca9f48deee3d39ca858e6c649f22b7d2cf
MD5 5ab96a8e6c78dc62acf4ec1ca8419a7c
BLAKE2b-256 b5373a794745ce7240621e718e533751212d9da0a599ed2218071095d749f2db

See more details on using hashes here.

Provenance

The following attestation bundles were made for owi_metadatabase_soil-0.1.0-py3-none-any.whl:

Publisher: publish.yml on OWI-Lab/owi-metadatabase-soil-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page