Skip to main content

GUI for viewing a Python Abstract Syntax Tree.

Project description

astviewer

Graphical User Interface for viewing Python Abstract Syntax Trees.

astviewer screen shot

Installation:

First install PyQt or PySide. Either one is fine, AstViewer automatically detects which Qt bindings are installed. If both bindings are installed it prefers PyQt over PySide (You can force AstViewer to use a certain binding by setting the QT_API environment variable to pyqt5, pyqt4, pyside or pyside2.)

If you are using the Anaconda Python distribution it is recommended to install PyQt as follows:

%> conda install pyqt

or, for PySide use

%> conda install pyside2

If you are not using the Anaconda Python distro, you can install the dependencies with Pip as follows:

%> pip3 install pyqt5

or

%> pip install pyside2

There is no conda recipe for the AstViewer, but you can use Pip to install it even if you use Anaconda. To install it type:

%> pip install astviewer

Usage:

Command line example:

%> pyastviewer myprog.py

Examples to use from within Python:

	>>> from astviewer.main import view
	>>> view(file_name='myprog.py')
	>>> view(source_code = 'a + 3', mode='eval')

Further links:

The Green Tree Snakes documentation on ASTs is available for those who find the Python ast module documentation too brief.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astviewer-1.1.3.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astviewer-1.1.3-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file astviewer-1.1.3.tar.gz.

File metadata

  • Download URL: astviewer-1.1.3.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for astviewer-1.1.3.tar.gz
Algorithm Hash digest
SHA256 ae63a6465b620bc3219b39adfb4bc7ad74b7e0262fd8dc44e90617509c5f7752
MD5 e7a854942e79e2e40f3522a7bb5f5520
BLAKE2b-256 c8f457d5b6b4db82c862cbd5b65919b9c88e92ca5acdfc7100efcdf0ed708dfe

See more details on using hashes here.

File details

Details for the file astviewer-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: astviewer-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for astviewer-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a1b5606bfebbc2f290108d10a9a5d4bf2fd91f0ea2a8c2e791b66eaedf212143
MD5 ebf6e3c6cb356a4585d49f7c41cb6a22
BLAKE2b-256 8a83b53d00193a9a589b728cccc3fa94efeafd4aa9987c8bc3c247ec78c65246

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page