An AST unparser for Python
Project description
============
AST Unparser
============
.. image:: https://badge.fury.io/py/astunparse.png
:target: http://badge.fury.io/py/astunparse
.. image:: https://travis-ci.org/simonpercivall/astunparse.png?branch=master
:target: https://travis-ci.org/simonpercivall/astunparse
.. image:: https://pypip.in/d/astunparse/badge.png
:target: https://crate.io/packages/astunparse?version=latest
An AST unparser for Python.
This is a factored out version of `unparse` found in the Python
source distribution; under Demo/parser in Python 2 and under Tools/parser
in Python 3.
Basic example::
import inspect
import ast
import astunparse
astunparse.unparse(ast.parse(inspect.getsource(ast)))
This library is single-source compatible with Python 2.7 and Python 3.4. It is
authored by the Python core developers; I have simply merged the Python 2.7 and
the Python 3.4 source and test suites, and added a wrapper. This factoring out
is to provide a library implementation that supports both versions.
The test suite both runs specific tests and also roundtrips much of the
standard library.
Similar projects include:
* codegen_
* astor_
* astmonkey_
* astprint_
None of these roundtrip much of the standard library and fail several of the basic
tests in the `test_unparse` test suite.
This library uses mature and core maintained code instead of trying to patch
existing libraries. The `unparse` and the `test_unparse` modules
are under the PSF license.
* Documentation: http://astunparse.rtfd.org.
Features
--------
* unparses Python AST trees.
.. _codegen: https://github.com/andreif/codegen
.. _astor: https://github.com/berkerpeksag/astor
.. _astmonkey: https://github.com/konradhalas/astmonkey
.. _astprint: https://github.com/Manticore/astprint
=========
Changelog
=========
Here's the recent changes to AST Unparser.
.. changelog::
:version: dev
:released: Ongoing
.. change::
:tags: docs
Updated CHANGES.
AST Unparser
============
.. image:: https://badge.fury.io/py/astunparse.png
:target: http://badge.fury.io/py/astunparse
.. image:: https://travis-ci.org/simonpercivall/astunparse.png?branch=master
:target: https://travis-ci.org/simonpercivall/astunparse
.. image:: https://pypip.in/d/astunparse/badge.png
:target: https://crate.io/packages/astunparse?version=latest
An AST unparser for Python.
This is a factored out version of `unparse` found in the Python
source distribution; under Demo/parser in Python 2 and under Tools/parser
in Python 3.
Basic example::
import inspect
import ast
import astunparse
astunparse.unparse(ast.parse(inspect.getsource(ast)))
This library is single-source compatible with Python 2.7 and Python 3.4. It is
authored by the Python core developers; I have simply merged the Python 2.7 and
the Python 3.4 source and test suites, and added a wrapper. This factoring out
is to provide a library implementation that supports both versions.
The test suite both runs specific tests and also roundtrips much of the
standard library.
Similar projects include:
* codegen_
* astor_
* astmonkey_
* astprint_
None of these roundtrip much of the standard library and fail several of the basic
tests in the `test_unparse` test suite.
This library uses mature and core maintained code instead of trying to patch
existing libraries. The `unparse` and the `test_unparse` modules
are under the PSF license.
* Documentation: http://astunparse.rtfd.org.
Features
--------
* unparses Python AST trees.
.. _codegen: https://github.com/andreif/codegen
.. _astor: https://github.com/berkerpeksag/astor
.. _astmonkey: https://github.com/konradhalas/astmonkey
.. _astprint: https://github.com/Manticore/astprint
=========
Changelog
=========
Here's the recent changes to AST Unparser.
.. changelog::
:version: dev
:released: Ongoing
.. change::
:tags: docs
Updated CHANGES.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
astunparse-1.1.0.tar.gz
(10.8 kB
view hashes)
Built Distributions
astunparse-1.1.0-py3.4.egg
(18.1 kB
view hashes)
astunparse-1.1.0-py3.3.egg
(18.4 kB
view hashes)
astunparse-1.1.0-py2.7.egg
(7.8 kB
view hashes)
Close
Hashes for astunparse-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a00a06f730242a7d8f977d372fb3291930ab0c291865c0ca7fc09678cf02b8b9 |
|
MD5 | 1c5fb39c280550ccc3d0696971732829 |
|
BLAKE2b-256 | 804455c5dac78cac97e5becdcb88d219abeb8ae9b8617aa85aaa1399ed087067 |