Skip to main content

DesignSafe API (dapi)

build and test License PyPI version Docs

dapi is a Python library for submitting, running, and monitoring TAPIS v3 jobs on DesignSafe via Jupyter Notebooks or the command line.

dapi

Features

Jobs

  • Generate TAPIS v3 job requests with automatic app parameter mapping
  • Submit, monitor (with progress bars), and manage jobs
  • Access and download job outputs
  • Discover and explore available DesignSafe applications

TMS Credentials

  • Establish, check, and revoke SSH keys on TACC execution systems (Frontera, Stampede3, LS6)
  • Works from any environment -- DesignSafe JupyterHub, command line, CI/CD

Files

  • Translate DesignSafe paths (/MyData, /CommunityData, /projects) to TAPIS URIs
  • Upload, download, and list files on DesignSafe storage

Database

Connects to SQL databases on DesignSafe:

Database dbname env_prefix
NGL ngl NGL_
Earthquake Recovery eq EQ_
Vp vp VP_

Define the following environment variables:

{env_prefix}DB_USER
{env_prefix}DB_PASSWORD
{env_prefix}DB_HOST
{env_prefix}DB_PORT

For e.g., to add the environment variable NGL_DB_USER edit ~/.bashrc, ~/.zshrc, or a similar shell-specific configuration file for the current user and add export NGL_DB_USER="dspublic".

Installation

pip install dapi

To install the development version:

pip install git+https://github.com/DesignSafe-CI/dapi.git@dev --quiet

In Jupyter notebooks:

%pip install dapi --quiet

To test the latest dev branch in a notebook:

%pip uninstall dapi --yes
%pip install git+https://github.com/DesignSafe-CI/dapi.git@dev --quiet

For local development (editable install — changes to source are reflected immediately):

pip install -e .

Quick Start

Authentication

Create a .env file with your DesignSafe credentials:

DESIGNSAFE_USERNAME=your_username
DESIGNSAFE_PASSWORD=your_password

Setup and submit a job

from dapi import DSClient

# Authenticate
client = DSClient()

# Establish TMS credentials (one-time per system)
client.systems.establish_credentials("frontera")

# Submit a job
job_request = client.jobs.generate(
    app_id="matlab-r2023a",
    input_dir_uri="/MyData/analysis/input/",
    script_filename="run_analysis.m",
    max_minutes=30,
    allocation="your_allocation",
)
job = client.jobs.submit(job_request)
final_status = job.monitor()

Database

from dapi import DSClient

client = DSClient()
df = client.db.ngl.read_sql("SELECT * FROM SITE LIMIT 10")
print(df)

Support

For any questions, issues, or feedback submit an issue.

Development

Install uv, then:

uv venv
uv pip install -e ".[dev]"

Run tests:

pytest tests/ -v

Build the package:

uv build

Documentation

Documentation uses Jupyter Book v2. To build and serve locally:

uv pip install -e ".[docs]"
jupyter-book start

License

dapi is licensed under the MIT License.

Authors

  • Prof. Krishna Kumar, University of Texas at Austin
  • Prof. Pedro Arduino, University of Washington
  • Prof. Scott Brandenberg, University of California Los Angeles

Metadata

Release files for dapi 0.6.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 dapi 0.6.1
File Size Uploaded
dapi-0.6.1.tar.gz 5.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for dapi 0.6.1
File Interpreter ABI Platform
dapi-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 MB

Release files / dapi-0.6.1.tar.gz

Download URL dapi-0.6.1.tar.gz
Size 5.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4660c7b139ad41d6aa7736368f5808286cbda89d8ad6476bfe36b5f843020bfe
BLAKE2b-256 checksum
How to use checksums
67d135e4d4ba9871b68eb276fbd80c91e61a0f3c5a5baf2396cb4adac65b8d1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 11, 2026.

Transparency log

Release files / dapi-0.6.1-py3-none-any.whl

Download URL dapi-0.6.1-py3-none-any.whl
Size 89.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6381825310618e05165cc58ac101ef9c63fd7e0826c76b5c0f2f51d36edb0720
BLAKE2b-256 checksum
How to use checksums
c83149314bfaa58ce9e97154385909b013e8918afb30f86b4b1bb23943f3a8f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.3

2 release files

0.6.2

2 release files

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.7

2 release files

0.4.5

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.0

2 release files

0.2.0

2 release files

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