Python Script for API Task package
- Updated: 2026/04/13
The Python Script for API Task package enables users to import and execute Python scripts using API Tasks. This package leverages the Python library support within API Tasks to implement complex data processing, mathematical computations and machine learning capabilities using API Tasks.
Overview
The Python Script for API Task package contains actions that executes Python scripts or a specific function within the script. The workflow sequence for executing Python script is as follows:
- Define the source Python script and session name using the Open action.
- Execute the script using one of the following actions:
- Execute function: Use when executing a specific function within the script.
- Execute script: Use when executing the entire script.
- Close the Python Script session using the Close action.
The package utilizes the Wasmer Python library integrated into the API Task runtime. The following Python libraries are supported:
| Libraries | Note |
|---|---|
|
Fully supported. |
|
Both libraries require WASM wheels to be installed on the local machine. |
|
Both libraries require WASIX to be installed and networking enabled on the local machine. |
|
lxml requires WASM to be installed on the local machine. |
|
aiohttp requires WASIX to be installed on the local machine. |
|
Fully supported. |
Actions in Python Script for API Task package
The following actions are available in this package
| Action | Description |
|---|---|
| Open |
The Open action defines the source Python and creates a session for executing Python scripts |
| Execute function |
The Execute function action executes a specific function within the Python script defined in the Open action. For an example, see Example of using Python script to join a list. |
| Execute script |
The Execute script action executes the Python script defined in the Open action. For an example, see Example of creating a PDF using Python script. |
| Close |
The Close action closes the session. See Close action. |