DesignSafe API
Project description
DesignSafe API (dapi)
dapi is a Python library for submitting, running, and monitoring TAPIS v3 jobs on DesignSafe via Jupyter Notebooks or the command line.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dapi-0.5.2.tar.gz.
File metadata
- Download URL: dapi-0.5.2.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe28af3b2b7e71231304c7e6e5feb3d92437e5e0f8ad04802ec9f9c97f9d0115
|
|
| MD5 |
9d52e212cbe6959d0f0729302d2a1ae1
|
|
| BLAKE2b-256 |
7df5a919e40875845e89cacbd9267f8a765257381a698a08e5e6c11fe4d3ac57
|
Provenance
The following attestation bundles were made for dapi-0.5.2.tar.gz:
Publisher:
pypi.yml on DesignSafe-CI/dapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dapi-0.5.2.tar.gz -
Subject digest:
fe28af3b2b7e71231304c7e6e5feb3d92437e5e0f8ad04802ec9f9c97f9d0115 - Sigstore transparency entry: 1216769834
- Sigstore integration time:
-
Permalink:
DesignSafe-CI/dapi@e09236149a8e82fedc690a71d8e688ebe0977fb3 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/DesignSafe-CI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@e09236149a8e82fedc690a71d8e688ebe0977fb3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dapi-0.5.2-py3-none-any.whl.
File metadata
- Download URL: dapi-0.5.2-py3-none-any.whl
- Upload date:
- Size: 55.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaa2cfb748534938f27bf6624a98fc1dabac607a7cc3e490a7f1c5415e165d7a
|
|
| MD5 |
0cea12ef792794596009d9fe6a131b13
|
|
| BLAKE2b-256 |
26beceb00e97fb94848d79c5dd45a5a01e1695f72791bc495ea742891e29f338
|
Provenance
The following attestation bundles were made for dapi-0.5.2-py3-none-any.whl:
Publisher:
pypi.yml on DesignSafe-CI/dapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dapi-0.5.2-py3-none-any.whl -
Subject digest:
eaa2cfb748534938f27bf6624a98fc1dabac607a7cc3e490a7f1c5415e165d7a - Sigstore transparency entry: 1216769888
- Sigstore integration time:
-
Permalink:
DesignSafe-CI/dapi@e09236149a8e82fedc690a71d8e688ebe0977fb3 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/DesignSafe-CI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@e09236149a8e82fedc690a71d8e688ebe0977fb3 -
Trigger Event:
push
-
Statement type: