$npx skillfedfor your agent

astor

Read/rewrite/write Python ASTs

Worth itPyPI Code GeneratorsReleased Dec 201920.0M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — astor-0.8.1-py2.py3-none-any.whl
v0.8.1 · released 2019-12-10 · Python !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7

Yes. astor is stable (Production/Stable status), has no dependencies, installs easily, carries no known vulnerabilities, and solves a real problem—converting ASTs back to readable code—that the Python standard library does not address well. The 2019 release date is offset by active repository maintenance and broad adoption (top 5000 packages). Install it if you need AST round-tripping or advanced tree inspection.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with no runtime dependencies.
  • Maintained actively as of 2026-02-17, though the latest release dates to 2019-12-10.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause (permissive): you may use, modify, and distribute astor freely in commercial and private projects, provided you include the license notice.

last release 2019-12-10 (2439 days) · last repo commit 2026-02-17 · 866 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 20,035,933 downloads/mo, #1,047 on PyPI

Verify before relying

pip install astor==0.8.1

import ast
import astor

code = "x = 1 + 2"
tree = ast.parse(code)
print(astor.to_source(tree))
  • Whether the 2019-12-10 release date reflects active maintenance or if the package is in maintenance-only mode despite recent commits.
Same gist for agents: .md · .json

What it is and what it does

astor is a library for reading, rewriting, and writing Python abstract syntax trees back to source code. It specializes in round-tripping ASTs—converting them back to readable Python without requiring the modified tree to be fully compileable or include line numbers and context information. The library also provides pretty-printing of AST structures and supports non-recursive tree walking, allowing you to visit nodes and their children on your own terms rather than through forced recursion.

The package has no runtime dependencies and runs on Python 2.7 and Python 3.4 and later. It is commonly used in code generation, refactoring tools, and AST analysis where you need to inspect or transform Python code programmatically and then output human-readable results. The library includes the astor.rtrip tool for comparing two source trees functionally after transformations like PEP 8 formatting.

Use it for

  • Generate readable Python code from modified ASTs in code generation or transpilation tools.
  • Compare two Python source files for functional equivalence after automated transformations.
  • Debug AST structures by pretty-printing them in a more readable format than the built-in ast module.
  • Build refactoring or linting tools that need to output modified code back to source.
  • Implement custom AST visitors that walk the tree non-recursively and rewrite nodes based on parent context.

Worth the install?

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

Worth it

Yes.

astor is stable (Production/Stable status), has no dependencies, installs easily, carries no known vulnerabilities, and solves a real problem—converting ASTs back to readable code—that the Python standard library does not address well. The 2019 release date is offset by active repository maintenance and broad adoption (top 5000 packages). Install it if you need AST round-tripping or advanced tree inspection.

Install

astor on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Maintained actively as of 2026-02-17, though the latest release dates to 2019-12-10.

License in practice

BSD-3-Clause (permissive): you may use, modify, and distribute astor freely in commercial and private projects, provided you include the license notice.

Quickstart

pip install astor==0.8.1

import ast
import astor

code = "x = 1 + 2"
tree = ast.parse(code)
print(astor.to_source(tree))

Verify before relying

  • Whether the 2019-12-10 release date reflects active maintenance or if the package is in maintenance-only mode despite recent commits.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 2,439 days since the last release
Last repo commit
First released
Downloads20,035,933 / month, #1,047 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: ImplementationProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Code GeneratorsTopic :: Software Development :: Compilers

Evidence: astor-0.8.1-py2.py3-none-any.whl

Tags

Capabilities
ast to python codepython ast decompilationast round-trippython code generation from astast pretty printingast tree manipulation
Topics
ast-toolscode-generationpython-internals
PyPI keywords
astcodegenPEP 8

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 › “python ast decompilation”

  • astorastor converts Python abstract syntax trees (ASTs) back to readable…
  • mapfile_parserParses compiled binary map files (GNU ld, clang lld, Metrowerks ld…
  • decompyle3Decompyle3 translates Python bytecode back into equivalent Python…

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
genson Worth it
PyPI · Python Modules · released Jul 2026

GenSON generates JSON Schema documents from JSON objects and can merge multiple schemas together, inferring a unified schema that describes the common structure of your data.

MITpure Python · 3.10+
19.4Mdownloads / mo

See also astunparse · ast-decompiler · tree-sitter-julia · anytree · gast · openqasm3 · astpretty · promql-parser · redbaron