{"id":22503,"library":"types-tree-sitter-languages","title":"types-tree-sitter-languages","description":"PEP 561 stub-only package providing type annotations for tree-sitter-languages, enabling type-checking of grammar definitions and language bindings. As of version 1.10.0.20250530, it supports Python >=3.9 and is maintained by the typeshed project. Releases track tree-sitter-languages versions with a date suffix for stub updates.","status":"active","version":"1.10.0.20250530","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["type-stubs","tree-sitter","type-hints","typeshed"],"install":[{"cmd":"pip install types-tree-sitter-languages","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Runtime package for which stubs are provided.","package":"tree-sitter-languages","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"Language","correct":"from tree_sitter_languages import Language"},{"note":"","wrong":null,"symbol":"get_parser","correct":"from tree_sitter_languages import get_parser"},{"note":"","wrong":null,"symbol":"get_language","correct":"from tree_sitter_languages import get_language"}],"quickstart":{"code":"from tree_sitter_languages import get_language, get_parser\n\nlanguage = get_language('python')\nparser = get_parser('python')\ntree = parser.parse(bytes('print(1)', 'utf8'))\nprint(tree.root_node.child(0).type)  # expression_statement","lang":"python","description":"Demonstrates basic usage: obtaining a language object and parser for Python, parsing a snippet, and accessing the syntax tree."},"warnings":[{"fix":"pip install tree-sitter-languages","message":"Stub package only provides type hints; you must install tree-sitter-languages separately for runtime use.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from tree_sitter_languages import get_language, get_parser' instead.","message":"The 'Language' class import path was deprecated in favor of direct use according to typeshed updates; the correct way is to use get_language and get_parser functions.","severity":"deprecated","affected_versions":">=1.10.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from tree_sitter_languages import get_language, get_parser'.","cause":"The Language class is not directly importable in newer versions of tree-sitter-languages; use get_language and get_parser functions.","error":"ImportError: cannot import name 'Language' from 'tree_sitter_languages'"},{"fix":"pip install tree-sitter-languages","cause":"The runtime package tree-sitter-languages is not installed.","error":"ModuleNotFoundError: No module named 'tree_sitter_languages'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}