Getting Started with the GastroPlusAPI Python Package
Introduction
This document details the steps for getting started interacting with the GastroPlus Orchestrator Service from Python. It walks through setting up your Python environment, configuring VS Code, and running the example Jupyter notebooks that accompany the GastroPlusAPI Python package.
Full reference documentation for the GastroPlus Orchestrator Service can be found in its own documentation set; this guide is focused solely on first‑time use/ setup of the Python package.
Requirements
To follow along you will need:
GastroPlus 10.2 or later installed and licensed.
Python ≥ 3.7 (tested with 3.11 & 3.12).
Ability to install Python packages (either globally or in a virtual environment).
Installing the GastroPlusAPI Python Package
After installing GastroPlus, the Python-related files are located in:
Throughout this guide that path is referred to as <OrchestratorPython>.
The GastroPlus Orchestrator folder, C:/ProgramData/Simulations Plus, Inc/GastroPlusOrchestrator/10.2 will be referred to as <Orchestrator>
Create and Activate a Virtual Environment
BASH
# create a working folder (optional)
mkdir %USERPROFILE%\GastroPlusPython
cd %USERPROFILE%\GastroPlusPython
# create the virtual environment
python -m venv gastro-env
# activate it (Windows)
gastro-env\Scripts\activate.bat
Once activated the prompt will be prefixed with (gastro-env). To deactivate later run deactivate.
Appearance of command prompt after ‘gastro-env’ virtual environment has been activated