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.3rc2.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.3rc2-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astviewer-1.1.3rc2.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.3rc2.tar.gz
Algorithm Hash digest
SHA256 ccb223b6cf384c37025231d8f8bb7efda9370031537bda69372c97b8cff48237
MD5 f153c29f13670232470f6cda522b61a1
BLAKE2b-256 56361b79649b515c2a0086a9869549bff3e92f243aaf1e50c87a411769f37acb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: astviewer-1.1.3rc2-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.3rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 7031d9b1c8af8a20d1e77245287b492a5cbaf0bad3d1c789cffca35f408c9a9b
MD5 630d1b2943f71f5de7682aa433a52200
BLAKE2b-256 a22725248ce6af7a72beac28c3dfb8c6bba1228403251b69525b2d2e78bb8d51

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