Python functions
We have added official support to the Python programming language in various Layrz modules, this expands Layrz's possibilities by allowing programming code to be written within these modules.
Restrictions
To grant the best performance and security, we have added some restrictions to the Python code that can be executed within the Layrz modules. These restrictions are:
- You only can iterate over data or N times using
range
, at maximum of 30 iterations. - You cannot import other modules, or use external libraries.
- You cannot use
eval
,exec
orcompile
functions. - All of the
__builtins__
are disabled.
Available / pre-imported modules
We have added some modules that you can use in your Python code, these modules are:
import base64
import collections.abc as c
import decimal
import fractions
import itertools
import json
import math
import random
import statistics
import time
import typing as t
import zoneinfo
from datetime import datetime, timedelta
from layrz_sdk.entities import *
Need more modules?
Runtime environment
The Python code is executed on version 3.13
in a sandboxed environment, this means that you cannot have files, network access or any other external resources than the ones mentioned above.
Typing support
Our runtime environment is 100% typing-capable, feel free to use type hints in your code, this will help you to understand the code better and will help us to provide better support in case you need it.