4 releases

0.4.2 Nov 17, 2025
0.4.1 Oct 26, 2025
0.4.0 Oct 26, 2025
0.3.0 Sep 15, 2025

#2893 in Parser implementations

Download history 285/week @ 2025-09-14 93/week @ 2025-09-21 75/week @ 2025-09-28 73/week @ 2025-10-05 142/week @ 2025-10-12 103/week @ 2025-10-19 301/week @ 2025-10-26 223/week @ 2025-11-02 193/week @ 2025-11-09 85/week @ 2025-11-16 37/week @ 2025-11-23 29/week @ 2025-11-30 12/week @ 2025-12-07

178 downloads per month
Used in mergiraf

MIT license

3.5MB
132K SLoC

C 131K SLoC // 0.0% comments JavaScript 1K SLoC // 0.0% comments Scheme 126 SLoC // 0.0% comments Rust 32 SLoC // 0.1% comments

This crate provides Python language support for the tree-sitter parsing library.

Typically, you will use the LANGUAGE constant to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
print('hello world')
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_python_orchard::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading Python parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

tree-sitter-python-orchard

crates pypi

Python grammar for Tree-sitter, forked from https://github.com/tree-sitter/tree-sitter-python

Note that unlike upstream, generated files are not checked into git, so you need to run tree-sitter generate after cloning this repository.

Contributions are welcome, so are co-maintainers.

Dependencies