Skip to content

algotom/scriptrunner

Repository files navigation

ScriptRunner

ScriptRunner_Logo


GUI software for rendering arguments of CLI Python scripts and scheduling runs


Motivation

In synchrotron facilities where Linux OS is the main platform, running data acquisition, data processing, or beamline operation is often done through Python command-line interfaces. This can be a hassle for users who are not familiar with Linux or command-line interfaces.

The idea of this GUI is to render the arguments of CLI scripts, making it easier for users to run Python scripts through a graphical user interface. Beyond that, ScriptRunner allows scheduling script runs in a flexible way, enabling users to run a group of scripts with ease. For example, a list of data acquisition or data processing scripts can be scheduled to run different acquisition modes or different data-processing pipelines in order.

To make it even more convenient for users, ScriptRunner allows modifying and changing Python scripts without the need for another script editor like VS Code, Gedit, or Vim.

Features

  • Automatic GUI generation for CLI Python scripts:

    ScriptRunner parses arguments from ArgParse-based CLI scripts and automatically renders them as user-friendly GUI input fields.

    Fig1

  • Run individual scripts or schedule multi-script workflows:

    Execute a single script on demand, or create a scheduled sequence of multiple scripts. This enables automated data acquisition, processing pipelines, or batch operations without manual intervention.

    Fig2

  • Built-in script editor with side-by-side comparison:

    Edit Python scripts directly inside the application, no need for external editors like VS Code or Vim. Compare two scripts side-by-side to track modifications or validate parameter changes.

    Fig3

  • Console logging and export:

    View real-time console output for each script and save logs to a file for debugging, documentation, or reproducibility.

    Fig3

Installation

Install Miniconda, Anaconda or Miniforge, then open a Linux terminal or the Miniconda/Anaconda PowerShell prompt and use the following commands for installation.

Using pip:

pip install scriptrunner-gui

Using conda:

conda install -c algotom scriptrunner-gui

Once installed, launching ScriptRunner with

scriptrunner

Using -h for option usage

scriptrunner -h

Installing from source:

  • If using a single file:
    • Copy the file scriptrunner.py. Install python.
    • Run:
      python scriptrunner.py
      
  • If using setup.py
    • Create conda environment
      conda create -n scriptrunner python=3.11
      conda activate scriptrunner
      
    • Clone the source (git needs to be installed)
      git clone https://github.com/algotom/scriptrunner.git
      
    • Navigate to the cloned directory (having setup.py file)
      pip install .
      

Usage

  • Select a base folder containing Python scripts.

  • Clicking a script will show the arguments of that script in the right panel.

  • Double-clicking a script will open the Editor panel window.

  • Clicking "Run Now" will run the current script.

  • Select a script and use "Add to schedule" to schedule multiple scripts. There is an option to add sleep time between scripts.

  • Enable/disable saving console output to a file using the checkbox.

  • By default, ScriptRunner only picks and displays ArgParse-based scripts. However, users can choose to display all Python scripts by running:

    scriptrunner -t "all"
    

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages