typed-ast
a fork of Python 2 and 3 ast modules with type comment support
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-astuv
uv add typed-astpoetry
poetry add typed-astInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
ast-commentsExtends Python's built-in `ast` module to…
permissive · top 15,000 on PyPI
types-typed-astProvides type stubs for the typed-ast package,…
permissive · top 15,000 on PyPI
astprettyPretty-print Python abstract syntax trees (AST)…
permissive · top 15,000 on PyPI
astatineAstatine provides helper functions and…
permissive · top 15,000 on PyPI
strip-hintsStrips type hints from Python source code while…
unclear · top 5,000 on PyPI
typeguardPerforms run-time type checking for Python…
permissive · top 1,000 on PyPI
jsoncommentParses JSON with comments, multiline strings,…
permissive · top 15,000 on PyPI
json-with-commentsParses and serializes JSON with support for…
permissive · top 15,000 on PyPI
gastProvides a unified Abstract Syntax Tree…
permissive · top 5,000 on PyPI
lxml-stubsProvides type annotations for the lxml package…
permissive · top 5,000 on PyPI