Skip to main content

A consistent AST for Python

Project description

Synr

Synr is a library that provides a stable Abstract Syntax Tree for Python.

Features

  • The Synr AST does not change between Python versions.
  • Every AST node contains line and column information.
  • There is a single AST node for assignments (compared to three in Python's ast module).
  • Support for returning multiple errors at once.
  • Support for custom error reporting.

Usage

import synr

def test_program(x: int):
  return x + 2

# Parse a Python function into an AST
ast = synr.to_ast(test_program, synr.PrinterDiagnosticContext())

Documentation

Please see https://synr.readthedocs.io/en/latest/ for documentation.

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

synr-0.6.0.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

synr-0.6.0-py3-none-any.whl (18.5 kB view hashes)

Uploaded Python 3

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