Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A library for defining and manipulating ASTs

Project Description

# iAST #

(Supports Python 3.3 and 3.4)

This library provides a way of defining and transforming abstract syntax trees (ASTs) for custom languages. It can be used to help build a compiler or other program transformation system.

iAST reads your language’s abstract syntax from an ASDL grammar, and automatically generates node classes. A standard visitor-style framework is provided for traversing, transforming, and pattern matching over trees. Nodes are hashable, have structural equality, and support optional type checking. (Parsing is not supported and should be handled by an external parser generator.)

Node definitions for the ASTs of Python 3.3 and Python 3.4 are provided out-of-the-box, along with tools for writing code templates and macros targeting Python code. However, the main framework works on ASTs for arbitrary languages.

## Examples ##

See [](examples/ for basic usage and visitors/transformers. See [](examples/ for a comparison with Python’s own ast module and the use of type checking. Both examples use abstract grammars from the corresponding ASDL files.

## Installation ##

To install from pip/PyPI:

` python -m pip install iast `

To use a development version:

` python -m pip install `

Python 3.3 and 3.4 are supported. The only dependency is [simplestruct](, which is used to define the node classes.

## Developers ##

Tests can be run with python test, or by installing [Tox]( and running python -m tox in the project root. Tox tests both Python 3.3 and 3.4 configurations. Building a source distribution (python sdist) requires the setuptools extension package [setuptools-git](

## References ##

[1]: [[1]]: Eli Bendersky’s rewrite of the Python ASDL parser, which powers iAST’s generation of nodes from ASDL.

Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (46.6 kB) Copy SHA256 Checksum SHA256 Source Jan 4, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting