Skip to content

Read data in your own Python

Use your own script, notebook or application. Reading needs project/data access and read-scoped authorization; it needs no compute permission, binding or run. The supported 0.x SDK currently reads bounded scientific curve profiles over preview contracts. It does not read every SQL table or every Workspace type.

Open Connect → Use Python → Download read configuration. Save configuration.json in your working directory. It contains a service address and project, not credentials; it creates no gateway or network tunnel. With Python 3.10 or later:

Terminal window
python3 -m venv .venv
source .venv/bin/activate
python -m pip install 'ophiolite[pandas,numpy,validation] @ git+https://github.com/tuna-soup/ophiolite-sdk@ac62ad00e2fe399756474cd655ee6b750966dd88'
ophiolite doctor --configuration configuration.json
ophiolite login --configuration configuration.json
ophiolite list --configuration configuration.json

This installs the Ophiolite SDK of release 2026.11.18.

Exact versionac62ad00e2fe399756474cd655ee6b750966dd88

On Windows activate with .venv\Scripts\activate. Approve read access in your browser using your own identity. doctor is offline unless --online is supplied. login --no-browser prints the approval links for a terminal without a browser. Login needs your deployment’s sign-in through an identity provider; if login reports that browser application access is not configured, ask your operator to set it up (Install › Sign-in) and to link your provider account to your Ophiolite user. Credentials stay in the private SDK cache; never put tokens in notebooks or logs. For separate accounts, pass a separate --credentials path on every command.

Choose the asset, exact revision and curve from discovery:

Terminal window
ophiolite fetch --configuration configuration.json --asset ASSET --revision REVISION --curve CURVE --output local-data

An exact-asset configuration already includes its selection, so you can use ophiolite fetch --configuration configuration.json --output local-data. The new private folder contains exact artifact.las, normalized curve.json and descriptor.json. Existing data is not overwritten. Keep the descriptor with the data: it records identity, scientific context and interpretation. Normalized missing samples are null; zero remains zero. Source units and order are preserved. Read/export access does not itself grant redistribution rights.

This example uses your downloaded configuration and SDK login. Choose actual curve names from the selected asset; GR and RHOB are examples, not inferred defaults.

import json
from pathlib import Path
from ophiolite import Client, Credential
from ophiolite.auth import default_path
config = json.loads(Path("configuration.json").read_text())
url, project = config["url"], config["project"]
credential = Credential.from_file(default_path(url, project))
with Client(url, project, credential) as client:
assets = list(client.assets())
# Set asset_id and exact_revision from the asset you selected.
data = client.read(asset_id, exact_revision, ["GR", "RHOB"])
frame, descriptor = data.to_frame()
print(frame)
print(data.workspace_url())

Keep the descriptor beside your DataFrame. Numerical views use NaN for missing samples; descriptor.attach(frame) attaches metadata only when requested. Different axes, units, depth references or scientific context can refuse a joint view. Read separately or explicitly choose a documented transformation; the SDK never silently resamples, converts units or infers a CRS/datum. The Workspace link opens the exact scientific revision and selected curve, subject to current access.

Start with one of the four tested templates: notebook, Python app, React app or agent workflow. Each has a README, synthetic mode, locked requirements and a test command. Synthetic mode needs no credential; its link demonstrates the URL format without serving Workspace.

For a configured calculation, authorize write access explicitly, then prepare exact input, run your inspected code locally and publish its inspected result:

Terminal window
ophiolite login --configuration configuration.json --write
ophiolite prepare --configuration configuration.json --script calculation.py --parameters parameters.json --work run
ophiolite run --configuration configuration.json --work run
ophiolite publish --configuration configuration.json --work run

ophiolite login keeps its credential in a file whose folder must be private to you (mode 0700 on Linux and macOS; chmod 700 the folder if the first login refuses it). A Python sign-in approved before release 2026.10.3 cannot read wells, wellbores or lineage or import bundles: run ophiolite login again and approve the new request in Workspace.

run calls your script as python calculation.py <work folder>. In the work folder it finds input.las (the exact prepared input) and run.json, whose config.parameters are your parameters; it writes the curves it wants published to curves.json there.

prepare does not execute Python. run executes with your local operating-system permissions; this is neither a sandbox nor hosted computation. Publication creates a separate derived asset and does not grant sharing. Units, NULLs and provenance remain scientific responsibilities, even when a request passes structural validation.

Retain the entire original private work folder. After a lost publication reply:

Terminal window
ophiolite recover --configuration configuration.json --work run

Recovery preserves the saved command and body. Changed code/input needs a new folder; a command ID alone cannot recover a lost folder. Sharing has no automatic retry: after an uncertain response, read current grants first and decide from that state. The SDK reference explains retry and error categories.

Terminal window
ophiolite export --asset <asset> --revision <revision> --curve GR --output well-a-bundle
ophiolite bundle check well-a-bundle # offline: no account or server needed

See Take exact curves with you.

ophiolite status checks the grant; ophiolite logout revokes/removes the SDK session. Expired access needs authorized login; a denied asset needs its owner’s grant. Do not switch credentials silently. A new login replaces the selected service/project cache and scopes. Preserve separate credentials for separate roles.

The local Python kit now installs compatibility package 0.3.0 over the SDK. Deprecated 0.2 modules remain for one announced transition release and, after fresh SDK login, use only the SDK-owned credential cache. Never copy old pilot caches. The retained Alice/Bob numerical exercise has its own Python/dependency requirements and explicit unit checks. SDK 0.x support does not promise stable 1.0, PyPI publication or production support.

On Linux and macOS, ophiolite run creates ordinary calculation outputs with private file permissions. It does not repair outputs from older runs or scripts that deliberately change permissions. If publication refuses a private checkpoint, check that the work folder belongs to you and its data files are readable only by you before retrying. Keep the same folder for recovery.