A CLI tool that automatically adds type annotations to Python code using static analysis and heuristics.
infer-types is a CLI tool that automatically adds type annotations to Python code using static analysis and heuristics. It helps developers annotate large, legacy codebases by inferring simple return types and reducing manual typing effort.
Python developers working on large or old codebases who need to add type annotations efficiently, and teams adopting type hints for better code maintainability.
It provides a fully automated, static approach to type inference with smart heuristics and typeshed integration, significantly speeding up the annotation process compared to manual typing.
A CLI tool to automatically add type annotations into Python code. Must have tool for annotating existing code.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Infers types 100% statically without executing code, allowing safe and fast annotation of large codebases with minimal effort, as highlighted in the README.
Uses multiple inference rules like function name patterns (e.g., 'is_' for bool) and control flow analysis, improving accuracy for common coding scenarios based on the documentation.
Leverages the typeshed repository to find annotations for unannotated dependencies, reducing gaps in type coverage as mentioned in the features list.
Defaults to Python 3.10+ type syntax such as 'str | None', promoting cleaner code, though it requires adjustments for older versions.
Output can have duplicated or misplaced imports, necessitating additional tools like isort for cleanup, which adds steps to the workflow as noted in the usage instructions.
The README admits it won't solve 100% of cases; complex logic or ambiguous types often need manual intervention, reducing effectiveness for advanced typing scenarios.
Modern syntax output may break compatibility with Python versions below 3.10 unless __future__ annotations are added, introducing extra work for legacy projects.