$npx skillfedfor your agent

gast

Python AST that abstracts the underlying Python version

Worth itPyPI Software DevelopmentReleased Nov 202520.1M downloads / moBSD 3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — gast-0.7.0-py3-none-any.whl
v0.7.0 · released 2025-11-29 · Python !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7

Yes. GAST is a low-friction, actively maintained utility with no dependencies, a permissive license, and zero known vulnerabilities. Install it if you're building tools that parse or analyze Python code across multiple versions and need to avoid version-specific AST branching logic.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Installation is straightforward with no runtime dependencies.
  • The package is actively maintained with a recent release and steady commit activity, making it reliable for production use.

License · maintenance · safety

BSD 3-Clause (permissive) — Licensed under BSD 3-Clause, a permissive license that allows free use, modification, and distribution with minimal restrictions, suitable for both open-source and commercial projects.

last release 2025-11-29 (258 days) · last repo commit 2026-06-24 · 147 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 20,135,601 downloads/mo, #1,044 on PyPI

Verify before relying

import ast
import gast

code = "x = 1 + 2"
tree = ast.parse(code)
gtree = gast.ast_to_gast(tree)
# Process gtree with version-independent AST
original_tree = gast.gast_to_ast(gtree)
  • Whether the package is actively used by major tools or frameworks that depend on cross-version AST compatibility
  • Performance characteristics when converting large or deeply nested ASTs
Same gist for agents: .md · .json

What it is and what it does

GAST is a compatibility layer that normalizes Python's Abstract Syntax Tree across different Python versions. It converts version-specific AST output from the standard ast module into a unified representation, then back again if needed. This solves the problem of AST structure differences between Python 2.7 and Python 3.x versions—for instance, how function arguments, exception handlers, and string literals are represented differently across versions.

The package provides the same API as the standard ast module, with three key additions: gast.parse() produces a normalized tree directly, gast.dump() shows the unified representation, and gast.ast_to_gast() / gast.gast_to_ast() handle bidirectional conversion. It's tested across Python 2.7 through 3.11, making it suitable for tools that need to analyze or transform code written for multiple Python versions without rewriting logic for each version's AST quirks.

Use it for

  • Building code analysis or refactoring tools that must work with codebases targeting multiple Python versions
  • Writing AST-based linters or formatters that need a single code path for Python 2 and 3 syntax
  • Implementing code generation or transpilation that normalizes input AST before processing
  • Analyzing legacy Python 2 code alongside modern Python 3 code in a unified framework

Worth the install?

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

Worth it

Yes.

GAST is a low-friction, actively maintained utility with no dependencies, a permissive license, and zero known vulnerabilities. Install it if you're building tools that parse or analyze Python code across multiple versions and need to avoid version-specific AST branching logic.

Install

gast on PyPI

Before you install

Installation is straightforward with no runtime dependencies. The package is actively maintained with a recent release and steady commit activity, making it reliable for production use.

License in practice

Licensed under BSD 3-Clause, a permissive license that allows free use, modification, and distribution with minimal restrictions, suitable for both open-source and commercial projects.

Quickstart

import ast
import gast

code = "x = 1 + 2"
tree = ast.parse(code)
gtree = gast.ast_to_gast(tree)
# Process gtree with version-independent AST
original_tree = gast.gast_to_ast(gtree)

Verify before relying

  • Whether the package is actively used by major tools or frameworks that depend on cross-version AST compatibility
  • Performance characteristics when converting large or deeply nested ASTs

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 258 days since the last release
Last repo commit
First released
Downloads20,135,601 / month, #1,044 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: gast-0.7.0-py3-none-any.whl

Tags

Capabilities
python ast compatibility layercross-version abstract syntax treeast normalization python 2 3unified ast representationast conversion between python versionsgeneric ast parserpython version-agnostic ast
Topics
ast-parsingcode-analysispython-compatibility

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 compatibility layer”

  • gastProvides a unified Abstract Syntax Tree representation that works…
  • astatineAstatine provides helper functions and utilities for working with…
  • qualnameProvides a `qualname()` function that emulates Python 3.3+'s…

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

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

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.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

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.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

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.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

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.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

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.

permissive licensepure Python
323.3Mdownloads / mo

See also astpretty · beniget · parso · asttokens · ast-comments · astunparse · ast-decompiler · astor · luaparser · PyMeta3