astroid
An abstract syntax tree for Python with inference support.
Install
astroid on PyPI
pip
pip install astroiduv
uv add astroidpoetry
poetry add astroidPackage facts
| License | LGPL-2.1-or-later (copyleft) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 6 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: astroid-4.3.0-py3-none-any.whl
Keywords: abstract syntax tree, python, static code analysis
About astroid
from the package's own PyPI description — quoted content, verbatim
Astroid
.. image:: https://codecov.io/gh/pylint-dev/astroid/branch/main/graph/badge.svg :target: https://codecov.io/gh/pylint-dev/astroid :alt: Coverage badge from codecov
.. image:: https://readthedocs.org/projects/astroid/badge/?version=latest :target: http://astroid.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black
.. image:: https://results.pre-commit.ci/badge/github/pylint-dev/astroid/main.svg :target: https://results.pre-commit.ci/latest/github/pylint-dev/astroid/main :alt: pre-commit.ci status
.. |tidelift_logo| image:: https://raw.githubusercontent.com/pylint-dev/astroid/main/doc/media/Tidelift_Logos_RGB_Tidelift_Shorthand_On-White.png :width: 200 :alt: Tidelift
.. list-table:: :widths: 10 100
-
- |tidelift_logo|
- Professional support for astroid is available as part of the
Tidelift Subscription_. Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it...
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Astroid provides an extended abstract syntax tree (AST) representation of Python source code with static inference and scope analysis capabilities, powering tools like pylint for code quality analysis.
Installation is straightforward with low friction—a pure Python wheel with only typing-extensions as a runtime dependency. The project is actively maintained with a recent release (6 days old) and steady commit activity, indicating reliable ongoing support.
Astroid is licensed under LGPL-2.1-or-later (copyleft). This means derivative works and modifications must be distributed under a compatible license, though linking from proprietary code is permitted under the library exception typical of LGPL.
Usage
pip install astroid==4.3.0
import astroid
module = astroid.parse('x = 1\nprint(x)')
for node in module.nodes_of_class(astroid.Assign):
print(node.as_string())
Requires Python 3.10 or later (supports 3.10, 3.11, 3.12, 3.13, 3.14).
Verdict: Astroid is a mature, actively maintained library well-suited for projects requiring Python AST analysis with inference capabilities. Its low install friction, copyleft licensing, and zero known vulnerabilities make it a solid choice for code analysis tools, though users must ensure LGPL compliance in their own projects.
Needs verification
- Whether the LGPL library exception applies to your specific use case (proprietary vs. derivative work distinction)
- Performance characteristics for large codebases or real-time analysis scenarios
Similar packages
copyleft · top 1,000 on PyPI
libcstpermissive · top 1,000 on PyPI
asttokenspermissive · top 1,000 on PyPI
matplotlibpermissive · top 1,000 on PyPI
ml-dtypespermissive · top 1,000 on PyPI
jsonpath-ngpermissive · top 1,000 on PyPI
marshmallowpermissive · top 1,000 on PyPI
pre-commitpermissive · top 1,000 on PyPI
flake8permissive · top 1,000 on PyPI
pure-evalpermissive · top 1,000 on PyPI