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

Uploaded Source

Built Distribution

synr-0.2.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: synr-0.2.2.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1031-azure

File hashes

Hashes for synr-0.2.2.tar.gz
Algorithm Hash digest
SHA256 61839abc9b4ce4d0a4336d2305bea9a2c9b53b329c1358a31a92824005a36661
MD5 faba44227cb519f8cb6f31de30530970
BLAKE2b-256 3de0849659bf0cab69a860251a1dbe2f16e647b791e976fde048e3a3f9518406

See more details on using hashes here.

File details

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

File metadata

  • Download URL: synr-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1031-azure

File hashes

Hashes for synr-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 16123b1bc5297b164349c55f57b90b85dab81b816252ae2464fd42172f95c2d4
MD5 8c5ad6834f1cd3bd6ac7f5f5693b724f
BLAKE2b-256 3509be6ff43f8d691a3cc6c8d31c247decd860bb348f506ba58871a4368e03d6

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