run-python-code
Execute Python code securely in a sandbox environment, with options for pip install commands, JSON parsing, timeout, memory allocation, and saving output files.
Instructions
Execute Python code in a sandbox.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
code | Yes | Python code | |
commands | No | Pip install commands | |
memory | No | Memory allocation in MB | |
parseJson | No | Parse output as JSON | |
saveOutputFiles | No | Save output files | |
timeout | No | Execution timeout in ms |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"code": {
"description": "Python code",
"type": "string"
},
"commands": {
"description": "Pip install commands",
"type": "string"
},
"memory": {
"description": "Memory allocation in MB",
"type": "number"
},
"parseJson": {
"description": "Parse output as JSON",
"type": "boolean"
},
"saveOutputFiles": {
"description": "Save output files",
"type": "boolean"
},
"timeout": {
"description": "Execution timeout in ms",
"type": "number"
}
},
"required": [
"code"
],
"type": "object"
}