Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
September 19, 2018 12:10
August 17, 2022 20:31
March 7, 2019 06:42
June 1, 2018 22:29


"Pie-Sappy" for research use only.

A passion project to help accelerate breakthroughs in medical physics research by bringing the power of Python into the Varian API ecosystem.

Quickstart (updated August 8th 2020)

To simpify the install process and to provide users with accelerated (pre-compiled) numerical libraries, Anaconda's python distribution and repos are recommended. The following documents the quickest path to a "live" jupyter notebook:

  • Access your Eclipse 15.5 (or later) TBOX desktop
  • Install Anaconda3
    • Choose to install for "Just Me" (unless you know what you are doing and have admin privlages on your machine)
    • Use defaults (don't add anaconda to path, but do set ananconda as your default python installation)
  • Optionally install google chrome or chromium browser (for better Jupyter Notebook experience) and set it as your default browser
  • Launch "Anaconda Prompt" by searching in Windows menu
  • In the prompt, execute the command:
    • pip install
  • Then execute the command jupyter notebook
  • Create a new notebook and see below for examples (be sure not to select "root" kernel).



  • Inside your conda env, execute pip install --upgrade
    • This will check and upgrade PyESAPI if a newer version is available

Visual Studio Code

  • Tested to work with new projects being built with pyesapi
  • Install Python Extension
  • Select your pyesapi36 conda env (bottom bar, left side)
  • Set path to conda in your User settings.json:
    • "python.condaPath": "C:\\Example\\Path\\To\\anaconda3\\Scripts\\conda.exe"
  • Set cmd to default integrated terminal in Workspace settings.json file (ref)
    • "": "C:\\Windows\\System32\\cmd.exe"
  • Linting is still experimental, but code completion seems to work, please report any issues you find
    • Flake8 is already included in the provided pyesapi36 conda env

Proxy and Git Considerations

  • Proxy for Anaconda
  • Install git in a conda env: conda install -c anaconda git
    • No admin privlages are arequired when installing git this way
  • Proxy for git: git config --global https.proxy


For those wishing to contribute to PyESAPI

Custom ESAPI DLL path

Set custom ESAPI_PATH (to DLLs) before import (bypasses production directory path search)

import os
os.environ['ESAPI_PATH'] = r'C:\Users\CoolKid\Source\Magic\Bin\Debug64'
import pyesapi
# ...

Stub Gen

To create lintable code and enable code completion (in Visual Studio Code at least) we generate python stubs for ESAPI libs...

  1. Download and install IronPython (2.7.9 tested to work) in default location (C:\Program Files\IronPython 2.7\ipy.exe).
  2. Load ironpython-stubs submodule git submodule update --init (ironstubs)
  3. Move to stubgen folder cd stubgen
  4. Execute script stubgen.ps1 (if you hit a Pdb prompt, type continue)
  5. Commit updates to stubs folder


  • [*] PyESAPI Stubs V1 (2.7 style, incomplete)
  • PyESAPI Stubs V2 (.pyi style, needs dev work)
  • Official PyPi release
  • [*] Visual Studio Code support
  • Versioning of stubs


Python interface to Eclipse Scripting API








No releases published


No packages published