skillfed

typed-ast

a fork of Python 2 and 3 ast modules with type comment support

typed-ast v1.5.5 4.3M downloads/30d#2,325 on PyPI233
Permissive license Apache License 2.0 Abandoned released

What it is and what it does

typed_ast is an abandoned Python package that provided AST (abstract syntax tree) parsers for Python 2.7 and Python 3 code with support for PEP 484 type comments. It was designed to parse type annotations in comments, a feature that predated Python's native type hint syntax. The parsers were independent of the Python version running them, allowing you to parse code written for different Python versions from a single environment.

The package is no longer maintained and should not be used for new projects. Python 3.8 and later versions incorporated all of typed_ast's functionality into the standard library `ast` module, making typed_ast obsolete. The project's repository is archived, with the last commit on 2023-07-03. If you encounter typed_ast as a dependency, migration to the standard library is strongly recommended.

Use it for:

  • Legacy projects that parse Python 2.7 code with type comments from a Python 3 environment (use standard `ast` if possible).
  • Tools that need to extract type information from older codebases written before native type hints existed.
  • Transitional codebases migrating from Python 2 to Python 3 that need unified parsing logic.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python 2.7 and Python 3 AST parsers with PEP 484 type comment support, independent of the Python version running the parser.

No. Do not install typed_ast for new projects. The package is abandoned and superseded entirely by the standard library `ast` module in Python 3.8+. If you encounter it as a transitive dependency, work with maintainers to remove it. For Python 3.6–3.7 projects, migrate to the standard `ast` module where possible; typed_ast offers no advantages on modern Python versions.

Install

typed-ast on PyPI

pip

pip install typed-ast

uv

uv add typed-ast

poetry

poetry add typed-ast

Installing typed-ast

Before you install

Medium install friction due to compiled wheels for multiple platforms. Project is abandoned as of 2023-07-03 with no further maintenance; the standard library `ast` module in Python 3.8+ supersedes all functionality.

License in practice

Apache License 2.0 is permissive, allowing use in most contexts without significant restriction.

Quickstart

pip install typed-ast==1.5.5
import typed_ast.ast3 as ast
tree = ast.parse('x: int = 5', mode='exec', feature_version=(3, 7))

Project is no longer maintained; Python 3.8+ users should use the standard library `ast` module instead.

Verify before relying

  • Whether any downstream packages still actively depend on typed_ast or if migration paths are documented.
  • Performance characteristics compared to the standard library `ast` module on modern Python versions.

Package facts

License Apache License 2.0 (permissive)
Python support supports the current Python release (>=3.6)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance abandoned — 1,137 days since the last release
Last repo commit (repository archived)
First released
Downloads 4,348,443/month — #2,325 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: typed_ast-1.5.5-cp310-cp310-macosx_10_9_x86_64.whl; typed_ast-1.5.5-cp310-cp310-macosx_11_0_arm64.whl; typed_ast-1.5.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; typed_ast-1.5.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; typed_ast-1.5.5-cp310-cp310-musllinux_1_1_aarch64.whl; typed_ast-1.5.5-cp310-cp310-musllinux_1_1_x86_64.whl; typed_ast-1.5.5-cp310-cp310-win_amd64.whl; typed_ast-1.5.5-cp311-cp311-macosx_10_9_x86_64.whl; typed_ast-1.5.5-cp311-cp311-macosx_11_0_arm64.whl; typed_ast-1.5.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; typed_ast-1.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; typed_ast-1.5.5-cp311-cp311-musllinux_1_1_aarch64.whl; typed_ast-1.5.5-cp311-cp311-musllinux_1_1_x86_64.whl; typed_ast-1.5.5-cp311-cp311-win_amd64.whl; typed_ast-1.5.5-cp36-cp36m-macosx_10_9_x86_64.whl; typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_aarch64.whl; typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_x86_64.whl; typed_ast-1.5.5-cp36-cp36m-win_amd64.whl

Development Status :: 7 - InactiveEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: MicrosoftOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development

Tags

python ast parser with type commentsparse python 2.7 syntaxpep 484 type comment parsingtyped abstract syntax treepython code parsing type hints
deprecatedast-parsingtype-comments

More Software Development packages