$npx skillfedfor your agent

astunparse

An AST unparser for Python

With conditionsPyPI Code GeneratorsReleased Dec 201914.0M downloads / moBSDPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — astunparse-1.6.3-py2.py3-none-any.whl
v1.6.3 · released 2019-12-22 · 2 runtime deps: wheel, six

Yes, if you work with Python versions supported at the last release (2019-12-22) and need reliable AST-to-source conversion. The code is stable and well-tested. No if you require support for newer Python versions—the abandoned status means no updates are coming. Consider alternatives if you need active maintenance.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Abandoned since 2019-12-22; no updates for Python versions beyond those listed in classifiers.
  • May not handle newer syntax features.
  • Low friction install with minimal dependencies (wheel, six).

License · maintenance · safety

BSD (permissive) — BSD license is permissive; you can use, modify, and distribute this code with minimal restrictions, though you must retain the license notice.

last release 2019-12-22 (2427 days) · last repo commit 2023-08-18 · 230 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 14,034,836 downloads/mo, #1,251 on PyPI

Verify before relying

import ast
import astunparse

code = "x = 1 + 2"
tree = ast.parse(code)
print(astunparse.unparse(tree))
print(astunparse.dump(tree))
  • Compatibility with Python versions released after 2019-12-22 and AST node types introduced after that date.
  • Whether roundtrip fidelity is maintained for Python constructs added after the last release.
Same gist for agents: .md · .json

What it is and what it does

astunparse is a library that converts Python AST (abstract syntax tree) objects back into readable source code and provides a pretty-printed dump of AST structure. It factors out the unparse utility from Python's standard library, making it available as a standalone package.

The library is built on mature, core-maintained code from the Python source distribution and roundtrips much of the standard library. It depends only on wheel and six, making installation straightforward. However, the project is abandoned—last updated 2019-12-22—so it will not receive updates for newer Python versions or syntax features.

Use it for

  • Recover source code from compiled or introspected AST objects for debugging or code analysis.
  • Generate readable Python code from programmatically constructed AST trees in code generation tools.
  • Pretty-print AST structure for educational purposes or to understand how Python parses code.
  • Roundtrip Python source through parse and unparse cycles to verify AST fidelity in testing.
  • Implement metaprogramming tools that need to display or manipulate AST as human-readable code.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you work with Python versions supported at the last release (2019-12-22) and need reliable AST-to-source conversion.

The code is stable and well-tested. No if you require support for newer Python versions—the abandoned status means no updates are coming. Consider alternatives if you need active maintenance.

Install

astunparse on PyPI

Before you install

Low friction install with minimal dependencies (wheel, six). Maintenance is abandoned—last release was 2019-12-22 and last commit 2023-08-18—so expect no active bug fixes or support for newer Python versions.

Abandoned since 2019-12-22; no updates for Python versions beyond those listed in classifiers. May not handle newer syntax features.

License in practice

BSD license is permissive; you can use, modify, and distribute this code with minimal restrictions, though you must retain the license notice.

Quickstart

import ast
import astunparse

code = "x = 1 + 2"
tree = ast.parse(code)
print(astunparse.unparse(tree))
print(astunparse.dump(tree))

Verify before relying

  • Compatibility with Python versions released after 2019-12-22 and AST node types introduced after that date.
  • Whether roundtrip fidelity is maintained for Python constructs added after the last release.

Package facts

LicenseBSD permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
wheelsix
MaintenanceAbandoned 2,427 days since the last release
Last repo commit
First released
Downloads14,034,836 / month, #1,251 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Code Generators

Evidence: astunparse-1.6.3-py2.py3-none-any.whl

Tags

Capabilities
ast to source codeunparse python astast pretty printpython code generation from astast roundtripdump ast treeast serialization
Topics
ast-manipulationcode-generationlegacy
PyPI keywords
astunparse

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “unparse python ast”

  • astunparseConverts Python abstract syntax trees (ASTs) back into source code…
  • ast-commentsExtends Python's built-in `ast` module to preserve comments as nodes…
  • reqifReqIF is a Python library for parsing, unparsing, formatting,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Code Generators packages

proto-plus Worth it
PyPI · Python Modules · released Aug 2026

Proto Plus wraps protocol buffers to provide Python classes that behave like native Python types while maintaining protocol buffer serialization and schema validation.

Install it if you're working with protocol buffers in Python and want a more Pythonic interface, or if you're using Google Cloud libraries that depend on it.

Apache-2.0pure Python · 3.10+
343.8Mdownloads / mo
Cython Worth it
PyPI · Python Modules · released Jul 2026

Cython is a source code translator that compiles Python code to C, enabling optional static typing and direct C/C++ interoperability to generate efficient native extensions.

Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.

permissive licensepure Python · 3.8+
136.1Mdownloads / mo
asttokens Worth it
PyPI · Python Modules · released Jul 2026

Annotates Python abstract syntax trees with the positions of tokens and source code text, enabling tools to map AST nodes back to their originating code for refactoring, analysis, and transformation.

permissive licensepure Python · 3.8+
134.8Mdownloads / mo
beartype Worth it
PyPI · Python Modules · released Dec 2025

Beartype is a runtime type checker that validates Python type hints at function call time, catching type violations before they cause downstream bugs.

Install it if you want runtime type safety for your annotated code or need to validate type hints on third-party packages.

MITpure Python · 3.10+
99.1Mdownloads / mo
llvmlite With conditions
PyPI · Code Generators · released Aug 2026

llvmlite provides a lightweight Python binding to LLVM's IR builder, optimizer, and JIT compiler APIs, enabling you to write JIT compilers and code generators without needing the full LLVM C++ API surface.

BSD-2-Clause AND Apache-2.0 WITH LLVM-exceptioncompiled wheel · 3.10+
69.3Mdownloads / mo
astor Worth it
PyPI · Code Generators · released Dec 2019

astor converts Python abstract syntax trees (ASTs) back to readable source code and provides tools for AST manipulation, inspection, and non-recursive tree traversal.

Install it if you need AST round-tripping or advanced tree inspection.

BSD-3-Clausepure Python
20.0Mdownloads / mo

See also ast-decompiler · ast-comments · astpretty · google-pasta · luaparser · gast · libcst · beniget