Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hchasestevens/show_ast
An IPython notebook plugin for visualizing ASTs.
https://github.com/hchasestevens/show_ast
ast ipynb ipython ipython-notebook visualization
Last synced: 2 months ago
JSON representation
An IPython notebook plugin for visualizing ASTs.
- Host: GitHub
- URL: https://github.com/hchasestevens/show_ast
- Owner: hchasestevens
- License: mit
- Created: 2016-09-03T16:06:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T14:09:41.000Z (over 2 years ago)
- Last Synced: 2024-05-22T14:32:52.893Z (7 months ago)
- Topics: ast, ipynb, ipython, ipython-notebook, visualization
- Language: Jupyter Notebook
- Size: 225 KB
- Stars: 98
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-python-ast - show_ast - An IPython notebook plugin for visualizing ASTs. (Tools)
README
# showast
[![PyPI version](https://badge.fury.io/py/showast.svg)](https://badge.fury.io/py/showast)
[![Liberapay receiving](https://img.shields.io/liberapay/receives/hchasestevens.svg)](https://liberapay.com/hchasestevens/)An IPython/Jupyter notebook plugin for visualizing abstract syntax trees.
Example usage
--------------
Examples can be found in [this IPython notebook](https://github.com/hchasestevens/show_ast/blob/master/Example.ipynb).```python
import showast
``````python
%%showast
print 1 + 2
```
![print 1 + 2 AST](http://i.imgur.com/vK3XTkX.png)```python
from showast import show_source
import antigravity
show_source(antigravity)
```
![antigravity module AST](http://i.imgur.com/NJY6xhw.png)Installation
-------------
```
pip install showast
```showast has the following Python dependencies:
```
ipython
graphviz
```You will also need to have [Graphviz](http://www.graphviz.org/download/) installed.
Use of the alternative nltk-based rendering engine requires the following packages:
```
nltk
pillow
```
When using this option, you will additionally need to have [Ghostscript](http://ghostscript.com/download/gsdnld.html) installed.Contacts
--------* Name: [H. Chase Stevens](http://www.chasestevens.com)
* Twitter: [@hchasestevens](https://twitter.com/hchasestevens)