Skip to main content

What is the Atoti Limits Python extension

The Atoti Limits Python extension is a Spring Boot auto-configuration that connects an Atoti Python session to a running Atoti Limits server. It allows Python users to define limits against cubes created in Jupyter notebooks or Python applications. The extension includes two components:
  • Java extension: A JAR that configures the connection between the Atoti Python session and the Atoti Limits server.
  • UI extension: A TypeScript/React extension that adds Atoti Limits functionality to the Atoti UI.
Both components are packaged in a single JAR file.
This extension replaces the old Python plugin, which is no longer supported for versions of the Atoti Python SDK later than 0.9.0. If you were using the old plugin, please migrate to this new extension to continue using Atoti Limits with Atoti Python.

Compatible versions

Atoti Limits versionAtoti Python version
6.1.236.1.23
4.2.10.9.12

Prerequisites

  • Java: 21 or higher
  • Python: 3.10 or higher
  • UV package manager: Latest version (installation guide)
  • Atoti license: A valid Base64-encoded license set in the ATOTI_LICENSE environment variable
  • A running Atoti Limits server

How the extension works

  1. A standalone Atoti Limits server starts and waits for a connection request.
  2. An Atoti Python session starts with the extension JAR loaded.
  3. After the cube is built and security is configured, a manual REST call triggers the connection.
  4. The extension sends connection information to the Atoti Limits server.
  5. The Atoti Limits server connects to the Atoti Python session and is ready to manage limits.

How to set up the extension

Step 1: Download the extension

Download the extension, which is available in the released artifacts accessible from this link.

Step 2: Start a standalone Atoti Limits server

A running Atoti Limits server is required before the Python session can connect. The server must be configured to communicate with the Atoti Python session. See the getting started section for more details on building the Atoti Limits server. Start the server with the following command:
where:
  • activeviam.apps.inter-server-event-service.issuer.target-servers[0].name specifies the name of the Atoti Python server, which is atoti by default
  • activeviam.apps.inter-server-event-service.issuer.target-servers[0].url specifies the URL of the Atoti Python server, which by default in the following Atoti Python session is http://localhost:7070
By default, the extension expects the Atoti Limits server to be available on http://localhost:3090. Use the LIMITS_BASE_URL environment variable, or the limits.autoconfiguration.limits-base-url Java property, to point the extension at a different URL. This property now also controls the URL that the browser-side UI extension connects to at runtime. Previously, setting the property only affected server-to-server communication, and the UI extension had localhost:3090 hardcoded.

Step 3: Extract the UI extension from the JAR

The UI extension is bundled inside the extension JAR. It must be extracted to a directory that the Atoti session can reference. Include the following function in your Atoti Python code to extract the UI extension to a temporary directory:

Step 4: Configure and start the Atoti Python session

The Atoti Python session must be configured with the extension JAR, the UI extension path, and the server URLs. By default, the extension expects the Atoti Python server to be available on http://localhost:7070, hence the use of port 7070 in the following session. Use the ATOTI_BASE_URL environment variable to control the Python server URL, and the LIMITS_BASE_URL environment variable to control the Atoti Limits server URL. The following example creates a session with the extension loaded:

Step 5: Include a slicing date hierarchy in the cube

Atoti Limits requires a slicing date hierarchy to evaluate limits at specific points in time. After creating the cube, ensure you have a slicing date hierarchy, for example with:

Step 6: Configure user roles

User roles in the Python session must match the roles expected by the Atoti Limits server. This ensures proper authorization and workflow management. The following example configures users and roles that match the default Atoti Limits server configuration:
The key roles are:
  • ROLE_LIMITS: Provides access to Atoti Limits functionality
  • ROLE_APPROVE_REJECT_LIMIT: Allows approving or rejecting limit changes
  • ROLE_EVALUATE_STRUCTURE: Allows triggering limit evaluations
  • ROLE_PROCESS_INCIDENT: Allows processing limit breaches
For a full list of roles, see Roles.

Step 7: Trigger the connection

After both servers are running and the cube is built, the connection between them must be triggered manually with a REST call.
In the Atoti Server Java API, Atoti Limits knows that all the cubes have been configured by the time the server has started, so it can start the connection process. In the Atoti Python SDK, the session starts before all cubes have been configured - and there is no definitive end to the cube configuration - so Atoti Limits doesn’t know when to start the process and thus requires the manual trigger.
The following example triggers and polls the connection:
The two connection endpoints are:
  • POST /limits/autoconfig/connect: Initiates the connection between the two servers
  • GET /limits/autoconfig/connected: Returns true or false to indicate the connection status
Navigate to your Atoti Python session URL and you can now define limits in your Atoti Python session using the Atoti Limits functionality!