Skip to main content

Uast, user abstract syntax tree, is a

Project description

Uast

Uast, User friendly Abstract Syntax Tree, is a wrapper of the python module AST. It provides an user friendly interface to work with abstract syntax tree.

Quickstart

To install Sequentium, use the following command:

pip install sequentium

Suppose that you want really to know what is contained in the script: example/example_1.py, but you don't want to open it because it is too big and so complicated. You can just print a schema of its structure to have an ideas what is going on:

import uast

parsed_script = uast.parse(source='example/example_1.py')
print(parsed_script.schema())

Quick start

Uast permits to past entire scripts or just Python syntax

Parse a script

Parse a Python Snippet

Suppose we have the following python snippet of code

example = """
class User:

    def __init__(self, username: str, password: str):
        username = self.username
        password = self.password

    def check_password(self) -> bool:
        self.password == 'foo'
"""

We can parse it using the following

import uast

parsed_code = uast.parse(example)

Command line interface

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

uast-0.0.0.tar.gz (14.9 kB view details)

Uploaded Source

File details

Details for the file uast-0.0.0.tar.gz.

File metadata

  • Download URL: uast-0.0.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for uast-0.0.0.tar.gz
Algorithm Hash digest
SHA256 ebca427c39eaad61c072bea729ddc0a6167bb02567c2dbf37eed0dbf0215eb49
MD5 0a8c8c831b3d93dced8670f5683cb1b2
BLAKE2b-256 baf3eef0d9b8c0e0cf8fa7ebcc95ca31643f280a46ef2d0be067558c8fd281db

See more details on using hashes here.

Supported by

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