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

Uploaded Source

Built Distribution

synr-0.4-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: synr-0.4.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.8.11 Linux/5.8.0-1040-azure

File hashes

Hashes for synr-0.4.tar.gz
Algorithm Hash digest
SHA256 35cd3e0739ad8a4d52b742534f14149bd70f60f1ff8779d96b3484123ced3640
MD5 f569b38de8c2f750919715711424b99f
BLAKE2b-256 3e1c7930553b96ed8caab2356eeea699db00a75b0f62b8423e835b51a447c75b

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: synr-0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.8.11 Linux/5.8.0-1040-azure

File hashes

Hashes for synr-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2f280cdc73d6f98154c97f13130c9e387635060436a0bf07483bb8c6423ee8aa
MD5 7fa537c1bd56e1f539bd7994aee1ec71
BLAKE2b-256 587830e0ce241d1f98119d500532524d52f73c5f4b4486b8265b5e151938e5b3

See more details on using hashes here.

Provenance

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