Python support in advanced processors
Learn how Python is supported in Zuora Mediation advanced processors, including high-performance in-platform execution and extended external execution with additional libraries.
Python is supported as a basic feature during new provisioning in Zuora Mediation and is available within the code editors of the Advanced Transformer, Advanced Aggregator, and Advanced Accumulator processors. You can add Python code to implement custom logic for data transformation and processing. To balance performance and flexibility, Python execution is available in two levels.
Level 1 (Default – High Performance)
Level 1 (Default – High Performance) is enabled for all tenants by default and is optimized for speed. Your Python code runs directly within the platform using an embedded execution environment (GraalVM), ensuring low latency and efficient execution.
This level supports a curated subset of Python standard library modules while restricting libraries that enable external network access or non-deterministic behavior. It is best suited for lightweight transformations, validations, and business logic that do not require external dependencies.
Supported libraries in Level 1 include commonly used Python standard library modules such as: math, datetime, json, re, collections, itertools, functools, random, statistics, heapq, bisect, copy, decimal, fractions, hashlib, hmac, base64, uuid, os, pathlib, tempfile, shutil, glob, fnmatch, csv, configparser, argparse, logging, unittest, asyncio, threading, subprocess, sqlite3, gzip, bz2, lzma, zipfile, tarfile, io, typing, dataclasses, enum, inspect, traceback, warnings, time, calendar, string, pprint, queue, selectors, signal, platform and other standard library modules available in CPython 3.10.14.
The following categories of libraries are restricted in Level 1: External networking and HTTP libraries such as requests, urllib, urllib3, http.client, http.server, and XML-RPC client/server modules are not supported due to security issues.
Level 2 (Extended Libraries – External Execution)
Level 2 (Extended Libraries – External Execution) is designed for advanced use cases that require additional libraries beyond the default set. In this level, Python code is executed via an external service, enabling access to the full Python standard library along with a curated set of pre-approved third-party libraries. Because execution happens outside the core platform, this approach introduces higher latency compared to Level 1.
Supported additional libraries in Level 2 include:
Flask==2.3.2, Werkzeug==3.0.4, numpy==1.24.4, scipy==1.10.1, pandas==2.0.2, scikit-learn==1.2.2, waitress==3.0.0, urllib3==1.26.16, loguru==0.7.0, prometheus-flask-exporter==0.22.4, pycodestyle==2.11.1, schedule==1.2.1
This level is ideal for data science, statistical analysis, and advanced processing scenarios that require external libraries.
Comparison of Python support levels
| Feature | Level 1 (Default – High Performance) | Level 2 (Extended Libraries – External Execution) |
|---|---|---|
| Availability | Enabled for all tenants by default | Feature-gated (must be enabled) |
| Execution environment | In-platform (GraalVM) | External Python service (via API) |
| Performance | Fast, low latency | Slower due to external calls |
| Library support | Subset of Python standard library | Full standard library + additional packages |
| Third-party libraries | Not supported | Supported (curated list) |
| Best use cases | Lightweight transformations, validations, business logic | Data science, statistical analysis, advanced processing |