Skip to content

Commit ab77c2a

Browse files
committed
update readme with output samples
1 parent 1457922 commit ab77c2a

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

CHANGELOG.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
2. Added Enum to define available NodeTypes as py_module_parser.NodeTypes.
55
3. Added parsing of function definition nodes.
66
4. Implemented parsing of decorators.
7-
5. Added an optional group_by_type argument to PyModulesParser. If set to True, the output will be in the GroupNodesByType model, with keys such as imports, variables, classes, and functions, and all nodes will be grouped hierarchically inside them.
7+
5. Parser results can now be dumped to Python dictionaries or JSON, as well as grouped by type. For more details, please refer to the example/ directory and the README file.
8+
9+
10+
11+

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ Because, output models is Pydantic models - you can do anything with them that y
172172

173173
### Output json
174174

175-
176175
```python
177176

178177
parsed_output = PyModulesParser(source_code).parse()
@@ -183,8 +182,11 @@ print("Result in json: \n", parsed_output_json)
183182
### Output dict
184183

185184
```python
186-
parsed_output = PyModulesParser(source_code).parse()
187185

186+
parsed_output = PyModulesParser(source_code).parse()
187+
parsed_output_group_dict = parsed_output.group_by_type().dict()
188+
print("Result as python dict: \n")
189+
print(parsed_output_group_dict)
188190

189191
```
190192

@@ -195,10 +197,14 @@ parsed_output = PyModulesParser(source_code).parse()
195197
3. Implement parsing of nested classes
196198

197199
## Changelog
198-
** 0.3.0 - First stable release**
200+
** 0.4.0 - First stable release**
199201

200202
1. Renamed FuncCallOutput to CallOutput to include Class calls as well as function calls.
201203
2. Added Enum to define available NodeTypes as py_module_parser.NodeTypes.
202204
3. Added parsing of function definition nodes.
203205
4. Implemented parsing of decorators.
204-
5. Added an optional group_by_type argument to PyModulesParser. If set to True, the output will be in the GroupNodesByType model, with keys such as imports, variables, classes, and functions, and all nodes will be grouped hierarchically inside them.
206+
5. Parser results can now be dumped to Python dictionaries or JSON, as well as grouped by type. For more details, please refer to the example/ directory and the README file.
207+
208+
209+
210+

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "py-module-parser"
3-
version = "0.4.0b0"
3+
version = "0.4.0"
44
description = "Python Module Parser is a library that parses Python modules and outputs information about imports, functions, variables, and their corresponding line numbers. This makes it easier to analyze and understand the structure of your Python code."
55
authors = ["Iuliia Volkova <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)