Get and activate your license

This project is partially open source. The source code of the Python interface is available on GitHub under the BSD 3-Clause License. The solver used in this project is not open source. You need a valid license key to use it.

Types of licenses

Trial license (free)

The license key A8C6DA-9405FB-E74FB9-C71C3C-207661-V3 can be used with networks containing up to 10 buses. For example, this key can be used to follow the tutorials in this documentation or for personal projects. This key is valid indefinitely.

Academic license (free)

Students and teachers are eligible for free unlimited licenses to use in academic projects. Please reach out to us at contact@roseautechnologies.com to obtain your free license key. The license key will be valid for one year and can be renewed.

Commercial license (paid)

For other commercial or personal use, a license has to be purchased. Please contact us at contact@roseautechnologies.com to obtain a personalized license.

How to activate the license in your project?

There are two ways to activate the license in your project:

Using the activate_license function

Call the function activate_license with the license key as argument. This function will activate the license for the current session. If you use this approach, it is recommended to store the license key in a file and read it from there to avoid hard coding it in your code and accidentally committing it to your repository. Example:

from pathlib import Path
import roseau.load_flow as rlf

rlf.activate_license(Path("my_license_key.txt").read_text().strip())

# Rest of your code here

where the file my_license_key.txt contains A8C6DA-9405FB-E74FB9-C71C3C-207661-V3 (replace with your license key).

Important

Do not share your license key with others. The license key is personal and should not be shared publicly. If you use a version control system like Git, make sure to exclude the file containing the license key from versioning by adding it to your .gitignore file.

How to set an environment variable?

If you are not sure how to set an environment variable, this article has instructions for Windows, MacOS and Linux. The section Persisting an environment variable explains how to make the environment variable persistent on your machine so that you don’t have to set it every time you open a new terminal.

For Jupyter Notebook users

If you are using a Jupyter Notebook, you can follow these instructions to set the environment variable:

  1. Create a file named .env in the same directory as you notebook with the following content (replace the key with your license key):

    ROSEAU_LOAD_FLOW_LICENSE_KEY="A8C6DA-9405FB-E74FB9-C71C3C-207661-V3"
    
  2. Add a cell to the beginning of your notebook with the following content and execute it:

    %pip install python-dotenv
    %load_ext dotenv
    %dotenv
    

    The first line will install the package python-dotenv if it is not already installed. The next lines will load the extension dotenv and load the environment variables from the file .env in the current directory (created in step 1).

For VS Code users

If you are using Visual Studio Code, you can create a file named .env in your project directory (similar to step 1 for Jupyter) and VS Code will automatically load the environment variables from this file when you run your code (including when using Jupyter Notebooks in VS Code).

For PyCharm users

If you are using PyCharm, you can add the environment variable to your Python Console settings as indicated in the screenshot below:

Pycharm Console environment variable