https://github.com/boxed/parso_utils
Misc utility functions to work with parso ASTs
https://github.com/boxed/parso_utils
Last synced: 8 months ago
JSON representation
Misc utility functions to work with parso ASTs
- Host: GitHub
- URL: https://github.com/boxed/parso_utils
- Owner: boxed
- License: mit
- Created: 2019-01-31T13:35:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-01T14:11:29.000Z (over 7 years ago)
- Last Synced: 2025-06-23T20:04:40.870Z (about 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parso utils
Misc utility functions to work with parso ASTs
- is_function_call(node)
- full_function_name(node): Simplifies the case of "foo()" and "foo.bar()" so it's easy to get "foo" and "foo.bar" from the node
- function_call_arguments(node): Given a function call node returns a dict with:
- positional: list of positional arguments. These are the argument nodes.
- kwargs: dict with keyword arguments
- arg_unpacks: stuff like *foo
- kwarg_unpacks: stuff like **foo
- walk_code: walk the ASTs of all code in a given directory (defaults to . and ignores some dirs like venv by default),
this takes care of recursing through the AST for you, but you can also stop recursion of a node by returning False from your callback