--- id: pydantic-monty-runtime version: "0.0.21" license: MIT license_treatment: permissive maintenance: active --- # pydantic-monty-runtime — The monty CLI binary — spawned as worker subprocesses by pydantic-monty License: permissive · Maintenance: active · Downloads: 328.0K/mo ## What it is and what it does pydantic-monty-runtime is a compiled binary package that installs the `monty` command-line tool—a sandboxed Python interpreter written in Rust. It can run Python code in three modes: interactive REPL, file execution, or as a subprocess worker driven by a parent process. The sandbox enforces resource limits (memory, execution duration, recursion depth, garbage collection intervals) and provides crash isolation via the monty-alloc allocator, which raises MemoryError on soft-limit crossing and exits with a dedicated status on hard-limit crossing. The package is primarily designed as a runtime dependency for pydantic-monty and pydantic-monty-client, which use it to execute untrusted or resource-constrained Python code safely. It supports optional type checking via ty, filesystem mounts with configurable access modes, and optional telemetry via Logfire (behind a feature flag). The binary is packaged for PyPI using the same model as uv and ruff, placing the compiled executable in the environment's scripts directory. Use it for: - Run untrusted Python code in a controlled sandbox with enforced memory and time limits - Execute Python scripts as isolated worker subprocesses with crash recovery - Type-check Python code before execution using the -t flag - Mount host directories into the sandbox for controlled file access with ro/rw/overlay modes - Integrate sandboxed Python execution into larger systems via pydantic-monty or monty-pool ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides the `monty` command-line binary, a sandboxed Python interpreter that runs Python code with resource limits and crash isolation, typically spawned as worker subprocesses by pydantic-monty. Yes, if you need sandboxed Python execution with resource limits and crash isolation. Install directly only if you are building on top of pydantic-monty or monty-pool; otherwise, install pydantic-monty (which pulls it in automatically). No known vulnerabilities, active maintenance, and permissive MIT license. Medium install friction is offset by precompiled wheels across platforms. ## Install pip install pydantic-monty-runtime uv add pydantic-monty-runtime poetry add pydantic-monty-runtime ## Installing pydantic-monty-runtime Before you install: Medium install friction due to precompiled wheels across multiple platforms and Python versions (3.10+). Actively maintained with recent releases; intended as a dependency pulled in by pydantic-monty rather than direct installation. License in practice: MIT license permits permissive use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install pydantic-monty-runtime # Then use the monty binary from the command line: # monty -c "print('hello world')" # monty file.py # monty --max-memory 10MB --max-duration 0.5 -c "code" Requires Python >= 3.10. The binary is precompiled; installation places it in the environment's scripts directory and assumes a compatible platform (macOS, Linux, or Windows). Verify before relying: - Whether the package works correctly when installed directly vs. only as a transitive dependency of pydantic-monty - Performance characteristics and overhead of the sandbox relative to standard Python execution - Completeness of stdlib subset implemented by the Monty interpreter ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 328.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sandboxed python interpreter, python sandbox runtime, monty cli binary, resource-limited python execution, crash-isolated python worker, python code sandbox, restricted python environment, sandbox, resource-limits, crash-isolation [View on SkillFed](https://skillfed.io/packages/pydantic-monty-runtime) · [View on PyPI](https://pypi.org/project/pydantic-monty-runtime/)