Skip to content

Your own application

An application of your own works with a project through the same access a person has. This guide uses two short programs from the examples/your-own-application folder of the Ophiolite integration repository. Copy that folder; the programs import only ophiolite and the Python standard library.

  • vshale.py reads LAS well logs (kind osdu:wks:work-product-component--WellLog:1.5.0, profile las2/1). For each log whose GR curve is in a gamma-ray unit (gAPI or API) on a metre depth axis, it computes a shale-volume curve VSH and publishes it as a derived result of that exact version of the log, under the source system application:vshale-example.
  • netsand.py does not import or call the first program. It finds those VSH curves by the source system the server recorded for them, and prints net sand per 100 m.

The program selects a log by its profile, the unit of its GR curve and the unit of its depth axis. The kind alone is not enough: it says what the data is, not that its gamma ray is in a unit the calculation expects.

Create a project access key on your account page. vshale.py needs a key with write access, and netsand.py only reads. Then, in the folder you copied:

Terminal window
pip install "ophiolite @ git+https://github.com/tuna-soup/ophiolite-sdk@<the commit llms.txt names>"
echo '{"schema": "ophiolite.local-configuration/1", "url": "https://ophiolite.example", "project": "<project id>"}' > configuration.json
export OPHIOLITE_ACCESS_KEY=oph_key_...
python vshale.py <asset id>
python netsand.py

This installs the Ophiolite SDK of release 2026.11.18.

Exact versionac62ad00e2fe399756474cd655ee6b750966dd88

python vshale.py <asset id> takes one log first, so you can check its result. Without an asset id the program takes every eligible log in the project. Each log it cannot use is named with the reason: fewer than 20 samples, or a curve that does not vary. Running it again changes nothing, because each send names the log version it came from and the server answers with the earlier result.

vshale.py exits with 0 when it wrote something or everything was already up to date. It exits with 2 when no log was eligible, and with 3 when the server refused the write (PermissionRefused, for example with a read-only key).

VSH is the linear gamma-ray index between the log’s own 5th and 95th percentiles of GR, clipped to 0–1. Missing samples stay missing. The published method records both percentiles. The index assumes that the cleanest and the shaliest rock of the log sit at those percentiles, and that gamma ray scales linearly between them. Radioactive sands, washouts and logs that cross several formations break those assumptions. For non-linear methods and picks of your own, see Shale volume from gamma ray.

netsand.py counts each sample below VSH 0.35 as the median spacing of the log’s depths. Its 100 m bins start at the first depth rounded down to a multiple of 100; each bin holds the depths from its top up to, but not including, its base.

Find another application’s results in Python

Section titled “Find another application’s results in Python”

Provenance is how one program finds what another wrote, without knowing anything about the other program but the name of its source system:

found = []
for item in client.assets():
if "VSH" not in item["curves"]:
continue
record = client.provenance(item["asset_id"], item["revision"]).record
if record and record["identity"]["source_system"] == "application:vshale-example":
found.append(item)
print(item["name"], item["revision"][:12])

A version stored before source records began has no record (record is None), so it is never a match.