How to run Python source code in Mavibot.ai
To run a source code (.py extension) the function code_executor(URL, params) is used, where
URL - the url to the source code (“https://mavibot.ai/handler.py” as an example)
params - the parameters that are needed for your code (they come as a JSON line)
The returned value is what the function returns
Example:

If you need to send API requests from a Russian IP address, we recommend using the Salebot proxy.
Example:
requests.get('https://google.com', proxies={'https': 'http://51.250.88.121:24532'}).text
139.59.148.123— Python code executor
Requirements for the source code:
Your code must include a handle(data) function that accepts a parameter containing a hash of the parameters you specified in the block settings. The function must return a value that will be passed back to the bot after execution. To split the result into the editor’s parameters, return it as JSON.
An example code you can see here: https://mavibot.ai/handler.py
You can use standard libraries, as well as those listed below:
requests
logger
gspread
oauth2client
numpy
pyzbar
fuzzywuzzy
python-Levenshtein
re
urllib
time
json
hmac
hashlib
beautifulsoup4
pandas
base64
xmltodict
mysql-connector-python
zeep
Google-api-python-client