Socket
Socket
Sign inDemoInstall

uast

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uast

Uast, user abstract syntax tree, is a


Maintainers
1

Readme

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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc