Scripting

Once you've imported the data, the most straight-forward thing to do is to run the pre-prepared scripts

View the scripts available

mbpy scripts list

Run a script

You can run each individual script by appending the line output above after mbpy scripts run, like this:

mbpy scripts run students_id --group health_checks

Run an entire group of scripts

Just use the group name by itself:

mbpy scripts run health_checks

Example output:

Write a script

These scripts are simply text files in the scripts folder. They can be grouped into directories. They have to end with .mbpy in order to be executed.

The idea is simple:

  1. Write a query with the command line. See "Querying via the command line" for how to do that.

  2. Copy the query into a text file that ends with .mbpy

  3. Place it into the appropriate directory

  4. Re-use it with mbpy scripts run your_script

Last updated