A CLI tool to run Python projects in sandboxed environments.
Project description
🛡️ Sandbox Engine
A fast, lightweight, and secure CLI tool for running Python projects in isolated environments.
🚀 Overview
sandbox-engine allows developers to instantly spin up Python applications (like FastAPI, Django, Flask, Streamlit) without messing up their global environment or touching their local project files.
It automatically detects your framework, analyzes your code to dynamically generate required dependencies, strictly isolates the execution environment, and cleans up the sandbox the moment you exit.
📦 Installation
Install globally using pip:
pip install sandbox-engine-cli
(Note: The PyPI package is named sandbox-engine-cli, but the terminal command is sandbox-engine).
🛠️ Core Commands
Navigate to any existing Python project directory and run:
scan
Instantly analyzes the project structure.
- Discovers all Python files.
- Locates potential application entrypoints (e.g.,
app.py,main.py). - Identifies existing virtual environments and dependency management files.
sandbox-engine scan
detect
Intelligently infers your application architecture.
- Auto-detects the web framework (Flask, FastAPI, Django, Streamlit, Gradio).
- Identifies the exact port the application intends to use.
- Deep AST Analysis: Scans your code to find all third-party imports, filtering out over 150 standard library modules to figure out exactly what your app needs to run.
sandbox-engine detect
run
Standard execution with dependency injection.
- Scans your imports and cross-verifies them against your existing
requirements.txt. - Automagically appends missing dependencies.
- Sets up a standard virtual environment (
venv) and runs the application.
sandbox-engine run
run --isolated (Recommended)
Zero-mutation execution. The safest way to test an untrusted or messy project.
- Creates a temporary, hidden
.sandboxenvironment. - Dynamically generates a
requirements.txtinternal to the sandbox. - Safely installs dependencies strictly within the isolated environment.
- Runs the application securely.
- Graceful Teardown: pressing
Ctrl+Cimmediately kills the spawned processes and destroys the sandbox directory, leaving your project cleanly exactly how you found it.
sandbox-engine run --isolated
🤝 Contributing
Contributions, issues, and feature requests are always welcome! Feel free to check the issues page.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file sandbox_engine_cli-1.0.1.tar.gz.
File metadata
- Download URL: sandbox_engine_cli-1.0.1.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31ffbbfc2937deda8b8c26eac0f0d4fb6cff3ef80c0bd6147cac1c26b2e071d5
|
|
| MD5 |
cb5ac798959a37844c23389253d54181
|
|
| BLAKE2b-256 |
1260d242d294a593d912005b59c6e407bb0f2d7688949008cc1b9045ce856d96
|