{"id":15034645,"url":"https://github.com/rustpython/rustpython","last_synced_at":"2025-09-09T20:57:27.584Z","repository":{"id":37280753,"uuid":"135201145","full_name":"RustPython/RustPython","owner":"RustPython","description":"A Python Interpreter written in Rust","archived":false,"fork":false,"pushed_at":"2025-05-05T09:14:39.000Z","size":70015,"stargazers_count":19975,"open_issues_count":423,"forks_count":1298,"subscribers_count":168,"default_branch":"main","last_synced_at":"2025-05-05T14:07:00.589Z","etag":null,"topics":["compiler","hacktoberfest","interpreter","jit","language","python-language","python3","rust","wasm"],"latest_commit_sha":null,"homepage":"https://rustpython.github.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RustPython.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-28T19:27:01.000Z","updated_at":"2025-05-05T12:46:48.000Z","dependencies_parsed_at":"2023-09-29T00:21:13.515Z","dependency_job_id":"aa67c2b5-71d6-4b29-838b-46534d8a6945","html_url":"https://github.com/RustPython/RustPython","commit_stats":{"total_commits":10340,"total_committers":434,"mean_commits":23.82488479262673,"dds":0.8178916827852998,"last_synced_commit":"2ccc7455133be258776e14d90fc933daa40cd6e3"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustPython%2FRustPython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustPython%2FRustPython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustPython%2FRustPython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustPython%2FRustPython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RustPython","download_url":"https://codeload.github.com/RustPython/RustPython/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253763955,"owners_count":21960484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","hacktoberfest","interpreter","jit","language","python-language","python3","rust","wasm"],"created_at":"2024-09-24T20:25:50.705Z","updated_at":"2025-09-09T20:57:27.572Z","avatar_url":"https://github.com/RustPython.png","language":"Rust","readme":"\u003cimg src=\"./logo.png\" width=\"125\" height=\"125\" align=\"right\" /\u003e\n\n# [RustPython](https://rustpython.github.io/)\n\nA Python-3 (CPython \u003e= 3.13.0) Interpreter written in Rust :snake: :scream:\n:metal:.\n\n[![Build Status](https://github.com/RustPython/RustPython/workflows/CI/badge.svg)](https://github.com/RustPython/RustPython/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/RustPython/RustPython/branch/main/graph/badge.svg)](https://codecov.io/gh/RustPython/RustPython)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Contributors](https://img.shields.io/github/contributors/RustPython/RustPython.svg)](https://github.com/RustPython/RustPython/graphs/contributors)\n[![Discord Shield](https://discordapp.com/api/guilds/1043121930691149845/widget.png?style=shield)][discord]\n[![docs.rs](https://docs.rs/rustpython/badge.svg)](https://docs.rs/rustpython/)\n[![Crates.io](https://img.shields.io/crates/v/rustpython)](https://crates.io/crates/rustpython)\n[![dependency status](https://deps.rs/crate/rustpython/0.1.1/status.svg)](https://deps.rs/crate/rustpython/0.1.1)\n[![Open in Gitpod](https://img.shields.io/static/v1?label=Open%20in\u0026message=Gitpod\u0026color=1aa6e4\u0026logo=gitpod)](https://gitpod.io#https://github.com/RustPython/RustPython)\n\n## Usage\n\n**Check out our [online demo](https://rustpython.github.io/demo/) running on WebAssembly.**\n\nRustPython requires Rust latest stable version (e.g 1.67.1 at February 7th 2023). If you don't\ncurrently have Rust installed on your system you can do so by following the instructions at [rustup.rs](https://rustup.rs/).\n\nTo check the version of Rust you're currently running, use `rustc --version`. If you wish to update,\n`rustup update stable` will update your Rust installation to the most recent stable release.\n\nTo build RustPython locally, first, clone the source code:\n\n```bash\ngit clone https://github.com/RustPython/RustPython\n```\n\nRustPython uses symlinks to manage python libraries in `Lib/`. If on windows, running the following helps:\n```bash\ngit config core.symlinks true\n```\n\nThen you can change into the RustPython directory and run the demo (Note: `--release` is\nneeded to prevent stack overflow on Windows):\n\n```bash\n$ cd RustPython\n$ cargo run --release demo_closures.py\nHello, RustPython!\n```\n\nOr use the interactive shell:\n\n```bash\n$ cargo run --release\nWelcome to rustpython\n\u003e\u003e\u003e\u003e\u003e 2+2\n4\n```\n\nNOTE: For windows users, please set `RUSTPYTHONPATH` environment variable as `Lib` path in project directory.\n(e.g. When RustPython directory is `C:\\RustPython`, set `RUSTPYTHONPATH` as `C:\\RustPython\\Lib`)\n\nYou can also install and run RustPython with the following:\n\n```bash\n$ cargo install --git https://github.com/RustPython/RustPython rustpython\n$ rustpython\nWelcome to the magnificent Rust Python interpreter\n\u003e\u003e\u003e\u003e\u003e\n```\n\nIf you'd like to make https requests, you can enable the `ssl` feature, which\nalso lets you install the `pip` package manager. Note that on Windows, you may\nneed to install OpenSSL, or you can enable the `ssl-vendor` feature instead,\nwhich compiles OpenSSL for you but requires a C compiler, perl, and `make`.\nOpenSSL version 3 is expected and tested in CI. Older versions may not work.\n\nOnce you've installed rustpython with SSL support, you can install pip by\nrunning:\n\n```bash\ncargo install --git https://github.com/RustPython/RustPython --features ssl\nrustpython --install-pip\n```\n\nYou can also install RustPython through the `conda` package manager, though\nthis isn't officially supported and may be out of date:\n\n```bash\nconda install rustpython -c conda-forge\nrustpython\n```\n\n### WASI\n\nYou can compile RustPython to a standalone WebAssembly WASI module so it can run anywhere.\n\nBuild\n\n```bash\ncargo build --target wasm32-wasip1 --no-default-features --features freeze-stdlib,stdlib --release\n```\n\nRun by wasmer\n\n```bash\nwasmer run --dir `pwd` -- target/wasm32-wasip1/release/rustpython.wasm `pwd`/extra_tests/snippets/stdlib_random.py\n```\n\nRun by wapm\n\n```bash\n$ wapm install rustpython\n$ wapm run rustpython\n\u003e\u003e\u003e\u003e\u003e 2+2\n4\n```\n\n#### Building the WASI file\n\nYou can build the WebAssembly WASI file with:\n\n```bash\ncargo build --release --target wasm32-wasip1 --features=\"freeze-stdlib\"\n```\n\n\u003e Note: we use the `freeze-stdlib` to include the standard library inside the binary. You also have to run once `rustup target add wasm32-wasip1`.\n\n### JIT (Just in time) compiler\n\nRustPython has a **very** experimental JIT compiler that compile python functions into native code.\n\n#### Building\n\nBy default the JIT compiler isn't enabled, it's enabled with the `jit` cargo feature.\n\n```bash\ncargo run --features jit\n```\n\nThis requires autoconf, automake, libtool, and clang to be installed.\n\n#### Using\n\nTo compile a function, call `__jit__()` on it.\n\n```python\ndef foo():\n    a = 5\n    return 10 + a\n\nfoo.__jit__()  # this will compile foo to native code and subsequent calls will execute that native code\nassert foo() == 15\n```\n\n## Embedding RustPython into your Rust Applications\n\nInterested in exposing Python scripting in an application written in Rust,\nperhaps to allow quickly tweaking logic where Rust's compile times would be inhibitive?\nThen `examples/hello_embed.rs` and `examples/mini_repl.rs` may be of some assistance.\n\n## Disclaimer\n\nRustPython is in development, and while the interpreter certainly can be used\nin interesting use cases like running Python in WASM and embedding into a Rust\nproject, do note that RustPython is not totally production-ready.\n\nContribution is more than welcome! See our contribution section for more\ninformation on this.\n\n## Conference videos\n\nCheckout those talks on conferences:\n\n- [FOSDEM 2019](https://www.youtube.com/watch?v=nJDY9ASuiLc)\n- [EuroPython 2018](https://www.youtube.com/watch?v=YMmio0JHy_Y)\n\n## Use cases\n\nAlthough RustPython is a fairly young project, a few people have used it to\nmake cool projects:\n\n- [GreptimeDB](https://github.com/GreptimeTeam/greptimedb): an open-source, cloud-native, distributed time-series database. Using RustPython for embedded scripting.\n- [pyckitup](https://github.com/pickitup247/pyckitup): a game engine written in\n  rust.\n- [Robot Rumble](https://github.com/robot-rumble/logic/): an arena-based AI competition platform\n- [Ruff](https://github.com/charliermarsh/ruff/): an extremely fast Python linter, written in Rust\n\n## Goals\n\n- Full Python-3 environment entirely in Rust (not CPython bindings)\n- A clean implementation without compatibility hacks\n\n## Documentation\n\nCurrently along with other areas of the project, documentation is still in an\nearly phase.\n\nYou can read the [online documentation](https://docs.rs/rustpython) for the\nlatest release, or the [user guide](https://rustpython.github.io/docs/).\n\nYou can also generate documentation locally by running:\n\n```shell\ncargo doc # Including documentation for all dependencies\ncargo doc --no-deps --all # Excluding all dependencies\n```\n\nDocumentation HTML files can then be found in the `target/doc` directory or you can append `--open` to the previous commands to\nhave the documentation open automatically on your default browser.\n\nFor a high level overview of the components, see the [architecture](architecture/architecture.md) document.\n\n## Contributing\n\nContributions are more than welcome, and in many cases we are happy to guide\ncontributors through PRs or on Discord. Please refer to the\n[development guide](DEVELOPMENT.md) as well for tips on developments.\n\nWith that in mind, please note this project is maintained by volunteers, some of\nthe best ways to get started are below:\n\nMost tasks are listed in the\n[issue tracker](https://github.com/RustPython/RustPython/issues). Check issues\nlabeled with [good first issue](https://github.com/RustPython/RustPython/issues?q=label%3A%22good+first+issue%22+is%3Aissue+is%3Aopen+) if you wish to start coding.\n\nTo enhance CPython compatibility, try to increase unittest coverage by checking this article: [How to contribute to RustPython by CPython unittest](https://rustpython.github.io/guideline/2020/04/04/how-to-contribute-by-cpython-unittest.html)\n\nAnother approach is to checkout the source code: builtin functions and object\nmethods are often the simplest and easiest way to contribute.\n\nYou can also simply run `python -I whats_left.py` to assist in finding any unimplemented\nmethod.\n\n## Compiling to WebAssembly\n\n[See this doc](wasm/README.md)\n\n## Community\n\n[![Discord Banner](https://discordapp.com/api/guilds/1043121930691149845/widget.png?style=banner2)][discord]\n\nChat with us on [Discord][discord].\n\n## Code of conduct\n\nOur code of conduct [can be found here](code-of-conduct.md).\n\n## Credit\n\nThe initial work was based on\n[windelbouwman/rspython](https://github.com/windelbouwman/rspython) and\n[shinglyu/RustPython](https://github.com/shinglyu/RustPython)\n\n[discord]: https://discord.gg/vru8NypEhv\n\n## Links\n\nThese are some useful links to related projects:\n\n- https://github.com/ProgVal/pythonvm-rust\n- https://github.com/shinglyu/RustPython\n- https://github.com/windelbouwman/rspython\n\n## License\n\nThis project is licensed under the MIT license. Please see the\n[LICENSE](LICENSE) file for more details.\n\nThe [project logo](logo.png) is licensed under the CC-BY-4.0\nlicense. Please see the [LICENSE-logo](LICENSE-logo) file\nfor more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustpython%2Frustpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustpython%2Frustpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustpython%2Frustpython/lists"}