Skip to content

Part 1 Usage

Janne Järvikylä edited this page Sep 11, 2026 · 4 revisions

How to use aiphoria

aiphoria comes with two ways to run:

  1. Running the showcase scenario (the example scenario)
  2. Running any user-defined scenario

Running showcase scenario is useful if this is your first time running aiphoria or want to test that the aiphoria installation is working properly.

1. Running the showcase

This will run example scenario and generate output to directory "aiphoria_example" to users home directory.
The output location can be defined by providing path as parameter path_to_output_dir.

  1. Create a new text file inside your project directory
  2. Open the text file using the text editor / IDE of your choice
  3. Copy contents from the box below and save the file with name you like e.g. aiphoria_example.py.
from aiphoria.example import run_example

run_example(remove_existing_output_dir=True)
  1. Run your newly created script by using the following command:
python aiphoria_example.py
  1. Check the showcase results Example output is created to directory named aiphoria_example inside users home directory by default.
    Sub-directories are created for every alternative scenario defined in settings file (check Part 3 Defining data for scenario for more information)

2. Running user-defined scenario

You can run any user-defined scenario by importing the aiphoria library and the calling the run_scenarios-function.
It's easy to run this in either terminal/command prompt or save the following code snippet to Python file (= file with the extension .py e.g. run.py)

NOTE: The links to example scenario and empty scenario files can be found in in Home

  1. Copy the contents of code snippet below to clipboard
from aiphoria import run_scenarios

run_scenarios("path_to_settings_file.xlsx", "output_directory_name", remove_existing_output_dir=True)
  1. Create new text file and paste the contents there
  2. Save the file with the extension .py to location of your choosing (e.g. run.py)
  3. Run the script file using Python:

In Windows:

python run.py

In Linux/macOs:

python3 run.py
  1. Check the results Output is created to directory that you defined as second parameter for run_scenarios-function. Sub-directories are created for every alternative scenario defined in settings file

In the next part we go through the scenario settings

Next part: Part 2 Settings

Clone this wiki locally