Jupyter Kernel Execution API

This Flask application provides an API for executing Python code in a Jupyter kernel, with endpoints for code execution, kernel restart, and health checks.

Key Features

Endpoints

Execution Endpoint

import requests

url = "https://lvwerra-executor.hf.space/execute"

print(requests.post(url, json={'code': 'x=10'}).json())
print(requests.post(url, json={'code': 'y=20'}).json())
print(requests.post(url, json={'code': 'print(y*x)'}).json())

Kernel Restart Endpoint

url = "https://lvwerra-executor.hf.space/restart"
print(requests.post(url).json())

Health Check Endpoint

url = "https://lvwerra-executor.hf.space/health"
print(requests.get(url).json())