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.5.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

synr-0.5.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file synr-0.5.0.tar.gz.

File metadata

  • Download URL: synr-0.5.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.8.12 Linux/5.8.0-1042-azure

File hashes

Hashes for synr-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d464afa8294a01e7d1d936a0baa1b626a10072b6ad96f035e2443b6b1d68ba28
MD5 312551a413f134ea48265b5b64303226
BLAKE2b-256 250611d686754333e964b29a902934908319b3fa591b6117e84c89aa269d8ed2

See more details on using hashes here.

File details

Details for the file synr-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: synr-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.8.12 Linux/5.8.0-1042-azure

File hashes

Hashes for synr-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a817ca41b1b678119c7acf68f59ce170717d3b25b6c77b289b4d17276120caa
MD5 aebfb93ed61e8e05f36269d2d6a7e6d7
BLAKE2b-256 38d921eeb9c9b417f52ec254b63085a69b906a33b5092e6323332032c32617a3

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