ast-decompiler
Python module to decompile AST to Python code
Decision gist · record as of 2026-08-14
Yes. The package is lightweight (no dependencies), actively maintained with recent commits, supports current Python versions, and has no known vulnerabilities. Install it if you need to convert ASTs back to source code for inspection, debugging, or code generation workflows.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with no runtime dependencies.
- The package is actively maintained with recent commits and supports current Python versions (3.8–3.13), making it reliable for modern projects.
License · maintenance · safety
permissive license (permissive) — Licensed under the Python Software Foundation License, a permissive license that allows broad use with minimal restrictions.
last release 2024-05-17 (819 days) · last repo commit 2026-06-30 · 40 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 175,951 downloads/mo, #10,256 on PyPI
Alternatives
Verify before relying
import ast
from ast_decompiler import decompile
code = decompile(ast.parse('(a + b) * c'))
print(code) # Output: (a + b) * c- Completeness of AST-to-code coverage: whether all Python constructs are supported or if some edge cases remain unhandled.
- Performance characteristics on large or deeply nested ASTs.
What it is and what it does
ast_decompiler takes a Python AST object and generates human-readable Python source code from it. This is useful when you have parsed code as an AST (via ast.parse or similar) and need to recover or inspect the original source, or when you're working with dynamically constructed ASTs and want to see what code they represent.
The package supports Python 3.8 through 3.13 and has no runtime dependencies, making it lightweight to integrate. It is actively maintained with recent activity, and the codebase is formatted with Black. The module is straightforward to use: pass an AST node to the decompile function and receive a string of reconstructed Python code.
Use it for
- Debug or inspect dynamically generated or modified ASTs by converting them back to readable code.
- Implement code transformation tools that need to display or log the result of AST modifications.
- Build educational tools or documentation that show how Python code maps to its AST representation.
- Generate test fixtures or example code from programmatically constructed AST objects.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is lightweight (no dependencies), actively maintained with recent commits, supports current Python versions, and has no known vulnerabilities. Install it if you need to convert ASTs back to source code for inspection, debugging, or code generation workflows.
Install
ast-decompiler on PyPI
Before you install
Low friction install with no runtime dependencies. The package is actively maintained with recent commits and supports current Python versions (3.8–3.13), making it reliable for modern projects.
License in practice
Licensed under the Python Software Foundation License, a permissive license that allows broad use with minimal restrictions.
Quickstart
import ast
from ast_decompiler import decompile
code = decompile(ast.parse('(a + b) * c'))
print(code) # Output: (a + b) * c
Verify before relying
- Completeness of AST-to-code coverage: whether all Python constructs are supported or if some edge cases remain unhandled.
- Performance characteristics on large or deeply nested ASTs.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 819 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 175,951 / month, #10,256 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development |
Evidence: ast_decompiler-0.8.0-py3-none-any.whl
Tags
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 › “ast to code generation”
- ast-decompilerConverts Python abstract syntax trees (ASTs) back into readable…
- asttokensAnnotates Python abstract syntax trees with the positions of tokens…
- astorastor converts Python abstract syntax trees (ASTs) back to readable…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also astroid · asttokens · astunparse · google-pasta · astor · beniget · astpretty · ast-comments · luaparser · decompyle3