Skip to main content
Monty can be used from Python, JavaScript/TypeScript, or Rust. Choose the installation method for your preferred language.

Python

1

Install with uv (recommended)

uv add pydantic-monty
2

Or install with pip

pip install pydantic-monty

Verify Installation

Verify your Python installation by running a simple script:
import pydantic_monty

# Create a simple interpreter
m = pydantic_monty.Monty('1 + 2')
result = m.run()
print(result)
# Output: 3

JavaScript / TypeScript

1

Install with npm

npm install @pydantic/monty
2

Or install with yarn

yarn add @pydantic/monty
3

Or install with pnpm

pnpm add @pydantic/monty

Verify Installation

Verify your JavaScript installation:
import { Monty } from '@pydantic/monty'

const m = new Monty('1 + 2')
const result = m.run()
console.log(result)
// Output: 3

Rust

1

Add Monty to your Cargo.toml

[dependencies]
monty = "*"
2

Run cargo build

cargo build

Verify Installation

Verify your Rust installation:
use monty::{MontyRun, MontyObject, NoLimitTracker, PrintWriter};

fn main() {
    let code = "1 + 2";
    let runner = MontyRun::new(
        code.to_owned(),
        "main.py",
        vec![]
    ).unwrap();
    
    let result = runner.run(
        vec![],
        NoLimitTracker,
        &mut PrintWriter::Stdout
    ).unwrap();
    
    println!("Result: {:?}", result);
    // Output: Result: Int(3)
}

System Requirements

Monty runs on all major platforms and architectures.

Supported Platforms

  • Linux: x86_64, aarch64
  • macOS: x86_64 (Intel), aarch64 (Apple Silicon)
  • Windows: x86_64
  • WASM: wasm32-wasip1-threads (JavaScript only)

Minimum Requirements

Python

Python 3.10 or higher

Node.js

Node.js 10.0.0 or higher

Rust

Rust 1.70 or higher

Package Sizes

Monty is designed to be lightweight and fast to install.
PackageSize
Python (pydantic-monty)~4.5 MB
JavaScript (@pydantic/monty)~12 MB
Rust (source)Varies by features

Next Steps

Quickstart Guide

Learn the basics with a hands-on quickstart

Core Concepts

Dive deeper into Monty’s features

Build docs developers (and LLMs) love