Cute little python module that sits atop the tree-sitter library to provide an easier to use and cleaner interface for interacting with source code.
Project description
Fast Trees
Cute little python module that sits atop the tree-sitter library to provide an easier to use and cleaner interface for interacting with source code
Install
pip install fast-trees
How to use
Easily work with source code data by using the high level API. Here's how you can grab the parameters of a java method:
mthd = """public static void main(String[] args, Object clazz) {
// This is a test
System.out.println(args[0]);
/**
This is another test!
*/
}
"""
parser = FastParser("java")
print(parser.get_method_parameters(mthd))
Repo already exists, continuing.
['args', 'clazz']
inline_comments = parser.get_method_inline_comments(mthd)
for c in inline_comments:
print(c)
// This is a test
/**
This is another test!
*/
Supported Languages
- Java
TODO
- Add ability to grab method parameters
- Add separation between parsing methods vs classes
- Add ability to get all methods in a class
- add ability to get all instance variables in a class
- Add more languages
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fast_trees-0.0.3.tar.gz
(9.5 kB
view hashes)
Built Distribution
Close
Hashes for fast_trees-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b63ff8146a425e88ee3863609909fa5c79fbf1f0a83bb4af5cc3a04c98e5c49 |
|
MD5 | 33225fca6e071eaea1a5a396cfaade4a |
|
BLAKE2b-256 | 05b181a2fe1a98eae27bf5f2b4f70e443287d4c99d09a1d7cda3c9cd10dadcee |