Skip to main content

astboom

PyPI PyPI - Python Version GitHub Code style: black

Visualize Python AST/CST/ST in console using ASCII graphics using various engines.

Engines available:

Example

Example usage

Usage

Simply provide a valid Python source code string as an argument and a corresponding AST/CST/ST will be displayed.

AST

Usage: astboom ast [OPTIONS] [SOURCE]

  Display Abstract Syntax Tree for a given source.

Options:
  --no-pos      Hide 'col_offset' and 'lineno' fields.
  --hide-empty  Hide empty fields.

lib2to3 CST

Usage: astboom cst [OPTIONS] [SOURCE]

  Display Concrete Source Tree for a given source.

Options:
  --show-prefix  Display value stored in 'prefix' field of the node.

Python parse tree

Usage: astboom st [OPTIONS] [SOURCE]

  Display Python parse tree for a given source.

LibCST tree

Usage: astboom libcst [OPTIONS] [SOURCE]

  Display LibCST tree for a given source.

Options:
  --hide-default   Hide fields that contain default value
                   (MaybeSentinel.DEFAULT).
  --hide-empty     Hide fields that contain empty values ([], (), '').
  --hide-fmt       Hide formatting-related fields and objects (whitespace,
                   newlines).
  --show-children  Show contents of the 'children' attribute.

If no source provided as an argument, then tool will attempt to read it from STDIN.

Installation

# pip install astboom

Getting started with development

# git clone https://github.com/lensvol/astboom
# poetry install

License

This project is licensed under the MIT License - see the LICENSE file for details

Authors

Release files for astboom 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astboom 0.4.2
File Size Uploaded
astboom-0.4.2.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for astboom 0.4.2
File Interpreter ABI Platform
astboom-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.5 kB

Release files / astboom-0.4.2.tar.gz

Download URL astboom-0.4.2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd6672701cef98c1bca63c132c46facb89c6171326c3e72b0319e6c74f8070ad
BLAKE2b-256 checksum
How to use checksums
7273a755c63794bc5de018337cbc34dcc6d3b5ee1c3b279fb7e0dce888653d17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.3 CPython/3.7.2 Darwin/18.7.0

Release files / astboom-0.4.2-py3-none-any.whl

Download URL astboom-0.4.2-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0b23173a830f3a4c4971076c936715ada2e9d63062cf9b95917930e5a93f860
BLAKE2b-256 checksum
How to use checksums
fb21110acf07d88dee640009879ae57f11153ff2fc84c96dd5d8854458084bb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.3 CPython/3.7.2 Darwin/18.7.0

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page