Skip to main content

DSIS Python Client

Python SDK for the DSIS (DecisionSpace Integration Server) API. Handles dual-token authentication (Azure AD + DSIS) and provides a fluent query builder for OData access.

Installation

pip install dsis-client

For protobuf bulk data decoding (grids, horizons, seismic):

pip install dsis-schemas[protobuf]

Quick Start

import os
from dsis_client import DSISClient, DSISConfig, Environment, QueryBuilder

config = DSISConfig(
    environment=Environment.DEV,
    tenant_id=os.getenv("DSIS_TENANT_ID"),
    client_id=os.getenv("DSIS_CLIENT_ID"),
    client_secret=os.getenv("DSIS_CLIENT_SECRET"),
    access_app_id=os.getenv("DSIS_ACCESS_APP_ID"),
    dsis_username=os.getenv("DSIS_USERNAME"),
    dsis_password=os.getenv("DSIS_PASSWORD"),
    subscription_key_dsauth=os.getenv("DSIS_SUBSCRIPTION_KEY_DSAUTH"),
    subscription_key_dsdata=os.getenv("DSIS_SUBSCRIPTION_KEY_DSDATA"),
    dsis_site="qa",
    auth_timeout=(5, 30),  # Optional: bound Azure AD + DSIS token requests
)

client = DSISClient(config)

query = (
    QueryBuilder(
        model_name="OpenWorksCommonModel",
        district_id="OpenWorksCommonModel_OW_SV4TSTA-OW_SV4TSTA",
        project="SNORRE",
    )
    .schema("Well")
    .select("name", "depth", "status")
    .filter("depth gt 1000")
    .expand("wellbores")
)

for well in client.execute_query(query):
    print(well)

QueryBuilder

QueryBuilder is the primary way to query data. It uses method chaining and IS the query object (no .build() needed).

query = (
    QueryBuilder(
        model_name="OW5000",
        district_id="OpenWorks_OW_SV4TSTA_SingleSource-OW_SV4TSTA",
        project="SNORRE",
    )
    .schema("Fault")
    .select("fault_id,fault_type,fault_name")
    .filter("fault_type eq 'NORMAL'")
    .expand("interpretations")
)

for item in client.execute_query(query):
    print(item)

Type-safe casting with model classes

Pass a model class to .schema() and use cast=True to get typed results:

from dsis_model_sdk.models.common import Basin

query = (
    QueryBuilder(model_name="OpenWorksCommonModel", district_id=dist, project=prj)
    .schema(Basin)
    .select("basin_name,basin_id,native_uid")
)

for basin in client.execute_query(query, cast=True):
    print(basin.basin_name)  # IDE autocomplete works

Pagination

execute_query() automatically follows odata.nextLink across all pages. Control with max_pages:

# All pages (default)
all_items = list(client.execute_query(query))

# First page only (max 1000 items)
first_page = list(client.execute_query(query, max_pages=1))

Bulk Data (Protobuf)

Fetch binary data (horizons, log curves, seismic) with get_bulk_data() or stream large datasets with get_bulk_data_stream():

from dsis_model_sdk.models.common import HorizonData3D
from dsis_model_sdk.protobuf import decode_horizon_data

binary_data = client.get_bulk_data(
    schema=HorizonData3D,
    native_uid="46075",
    district_id=district_id,
    project=project,
)
decoded = decode_horizon_data(binary_data)

For large datasets, stream in chunks:

for chunk in client.get_bulk_data_stream(
    schema=SeismicDataSet3D,
    native_uid=seismic,
    query=query,
    chunk_size=10 * 1024 * 1024,  # 10 MB
    stream_retries=2,
):
    process(chunk)

Set stream_retries to retry transient failures while reading streamed chunks. Retries reopen the stream and assume the endpoint returns the same bytes across reconnects. The timeout value on streamed downloads applies to connection setup and waiting for the next bytes, not to the full transfer duration.

For authentication, set auth_timeout on DSISConfig to bound Azure AD token acquisition and DSIS token refresh requests:

config = DSISConfig(
    ...,
    auth_timeout=(5, 30),  # (connect_timeout, read_timeout)
)

Error Handling

from dsis_client import DSISAuthenticationError, DSISAPIError, DSISConfigurationError

try:
    client = DSISClient(config)
    for item in client.execute_query(query):
        print(item)
except DSISConfigurationError as e:
    print(f"Bad config: {e}")
except DSISAuthenticationError as e:
    print(f"Auth failed: {e}")
except DSISAPIError as e:
    print(f"Request failed: {e}")

Logging

import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("dsis_client").setLevel(logging.DEBUG)

Documentation

Contributing

See CONTRIBUTING.md.

License

MIT

Metadata

Release files for dsis-client 1.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dsis-client 1.8.1
File Size Uploaded Provenance Actions
dsis_client-1.8.1.tar.gz 21.2 kB With provenance Details for dsis_client-1.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dsis-client 1.8.1
File Interpreter ABI Platform Actions
dsis_client-1.8.1-py3-none-any.whl Python 3 none any Details for dsis_client-1.8.1-py3-none-any.whl

Total release size: 54.6 kB

Release files / dsis_client-1.8.1.tar.gz

Download URL dsis_client-1.8.1.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3f25bbce311f01786341b214c6bd80ebac42010b3bca39470dd897e382873a9d
BLAKE2b-256 checksum
How to use checksums
dd2b65188532bbc453f91647e7beedc519dcbca7a830fe8de7fe30e36f182d7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / dsis_client-1.8.1-py3-none-any.whl

Download URL dsis_client-1.8.1-py3-none-any.whl
Size 33.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b7460d1360154e260e638808d9262d0d9d51f6be85f25389d4ea5503abe55e1
BLAKE2b-256 checksum
How to use checksums
c1818ea5ebecca307db5e49743a9e1ecc451d28c63909637eeeca6a725a95095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Security for dsis-client 1.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dsis_client-1.8.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page