Support resources

Flare™ Python Cookbook

Customize and automate your tasks with ready-to-use recipes

The Flare Python Cookbook provides a fast-track and user-friendly path for novice and non-expert Python users to familiarize themselves with writing scripts, and take advantage of extended Flare functionality.

The Cookbook includes ready-to-use Python recipes (‘snippets’) which perform a specific task as included. Use these simple, but fully functional, recipes as building blocks for creating more advance customized workflows.   

Although the Flare Python Cookbook is designed to support novice and non-expert Python users, more experienced users might also benefit from it as it provides friendly first contact with the Flare Python API style and functionalities.

New recipes featuring additional functionality will be available in future releases of the Flare Python Cookbook. In the meantime, if you would like a new recipe please contact Cresset support.

The Flare Python Cookbook uses the Flare Python API which extends Flare functionality by enabling medicinal and computational chemists to automate tasks, customize their workflows or develop new science.

If you would like to access the Flare Python Cookbook, pelease contact Cresset support for details.

Cookbook snippet example

How to run the snippets from the Flare GUI

The Flare Python Interpreter and Python Console windows in the Flare GUI are user-friendly and versatile environments for running Python interactively and from scripts from the Flare GUI.

Flare Python tab in the Flare GUI

Run the Flare Python Cookbook from the Python Interpreter and Python Console windows

Recipes in the Flare Python Cookbook can be run from the GUI using the Flare Python Console and Python Interpreter windows.

The Python Console executes lines of code as you type them. If you’re a novice user, it’s worth familiarizing yourself with Python commands by executing a few lines of code.

Use the Python Interpreter window to write, load, run, save and re-use Python scripts and snippets copied from the Cookbook:

  • Execute the code from the Python Interpreter window by pressing the ‘Run’ button
  • Save changes made to the snippet into a new Python script (‘Save As’)
  • Saved snippets can be reused at a later stage by loading them into the Python Interpreter (‘Load’)

Flare Python Interpreter

Run snippets from the command line

Confident Python users might prefer to run Flare experiments behind the scenes and call the Flare Python API from the command line. In these instances you can export the snippet code from the Flare Python Cookbook into a Python script, for example, using the Python Interpreter extension as described above and run it with the pyflare command line binary.


Most snippets will run from an open Flare project within the GUI and from the command line. However, some snippets require user intervention and will only work when running an open Flare project in the GUI. For each snippet, this is indicated in the Cookbook in the ‘Platform’ section.


Request a software evaluation, Torx® demo or Discovery CRO discussion

Contact us today