Expand description
Python language parser using Tree-sitter
Extracts symbols from Python source code:
- Functions (def, async def)
- Classes (regular, abstract)
- Methods (regular, async, static, class methods, properties via @property)
- Decorators (tracked in scope)
- Lambda expressions assigned to variables
- Local variables (inside functions)
- Global variables (module-level non-uppercase variables)
- Constants (module-level uppercase variables)
- Imports/Exports
Structs§
- Python
Dependency Extractor - Python dependency extractor
- Python
Package - Represents a Python package configuration with its location
Functions§
- find_
all_ python_ configs - Recursively find all Python configuration files (pyproject.toml, setup.py, setup.cfg) in the repository, respecting .gitignore
- find_
python_ package_ name - Find the Python package name from pyproject.toml, setup.py, or setup.cfg This is used to determine which imports are internal vs external
- parse
- Parse Python source code and extract symbols
- parse_
all_ python_ packages - Parse all Python packages in a monorepo and track their project roots
- reclassify_
python_ import - Reclassify a Python import using the project’s package name Similar to reclassify_go_import() and reclassify_java_import()
- resolve_
python_ import_ to_ path - Resolve a Python import to a file path