Skip to content

bimalpaudels/interpreter-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Interpreter Backend (FastAPI)

Overview

This backend is a demonstration of the restricted package in action — built using FastAPI.

It showcases the use of restricted's default configuration to safely evaluate user-submitted Python code with custom import restrictions and structured error handling. The API provides an endpoint to submit code and receive output, making it ideal for quick browser-based coding.

Demo

The frontend of this demo is hosted in Vercel.

Demo

Features

  • "Sandboxed" Python execution.
  • Custom import restrictions with helpful error messages.
  • Timeout protection to avoid infinite loops.

Installation and Usage

  1. Clone the repo
git clone https://github.com/bimalpaudels/interpreter-api.git
cd interpreter-api
  1. Install dependencies (uv recommended)
pip install -r requirements.txt
  1. Run the server
uvicorn main:app --reload

About

FastAPI backend for a Python Online Interpreter.

Topics

Resources

Stars

Watchers

Forks

Contributors