Typify
Typify is a usage-driven Python type inference system that automatically infers types for unannotated Python codebases. The project consists of two parts:
MotivationPython is one of the most widely used programming languages in the world, yet the vast majority of real-world Python code remains unannotated. Studies show that fewer than 10% of annotatable code elements carry explicit type annotations. This creates real problems for developers: without type information, IDEs cannot offer reliable autocompletion, refactoring tools operate blindly, and entire classes of bugs go undetected until runtime.
Adding annotations manually is tedious and error-prone, especially in large or legacy codebases. The goal of Typify is to automate this process, recovering precise type information across an entire project without requiring developers to write a single annotation by hand. ApproachTypify is a purely static type inference engine. It builds a dependency graph of the entire project, schedules modules in topological order, and propagates type information across functions, classes, and module boundaries using iterative fixpoint analysis.
The core insight is usage-driven inference: types are inferred not from declarations, but from how variables and functions are actually used throughout the codebase. ExampleConsider a function with no annotations:
Somewhere else in the project, it is called like this:
Existing tools treat each function in isolation and cannot infer anything about This call-site propagation works recursively and cross-module, meaning types flow naturally through the entire project as Typify analyzes it. Unlike local-only inference tools, Typify uses a whole-project usage-driven analysis. It tracks how values flow across files and function calls, allowing it to infer precise types such as:
instead of broad approximations like EvaluationTypify was evaluated on two benchmark datasets, ManyTypes4Py and Typilus, against static checkers (Pyright, Pyre Infer), a deep learning model (Type4Py), and the state-of-the-art hybrid system (HiTyper). Key findings:
Feature Comparison
As shown above, Typify stands out because it combines analysis of the entire project with predictable execution, while also supporting optional ML features. Unlike many existing tools, it does not focus on just one strength at the expense of others. Visual Studio Code ExtensionThe VS Code extension brings Typify directly into your editor. Open a Python project and Typify automatically analyzes your code in the background, showing inferred types on hover and letting you insert annotations into your source with a single click. Requirements
Typify sets itself up automatically on first launch. No extra installs are required. InstallationFrom inside VS Code
From the MarketplaceTypify is also available on the Visual Studio Code Marketplace.
Simply copy the command, head over to VS Code, press
Once installed, Typify activates automatically whenever you open a Python file. On the first run it creates a small isolated Python environment in the background. This only happens once. FeaturesLive Type InferenceTypify continuously analyzes your project and infers:
The analysis updates automatically about one second after you stop typing, no save or manual run required. Hover CardsHover over any variable, parameter, function, or class to see:
One-Click AnnotationWhen Typify infers a type, an Annotate button appears in the hover card. Clicking it inserts the annotation directly into your source code. Supported annotations include:
You can also annotate from the Command Palette using:
Status BarThe bottom-right status indicator shows Typify's current state:
Clicking the status item opens the Typify sidebar.
Sidebar PanelThe Typify sidebar provides:
Optional inference modes can be enabled individually or together: Context RetrievalUses a retrieval index of annotated Python code to suggest types for unresolved symbols based on contextual similarity. Useful for functions or variables with little or no usage evidence. Augment Context (experimental)Improves retrieval quality by incorporating additional surrounding project context into retrieval queries. Type4Py Neural ModelIntegrates the Type4Py deep-learning model as a fallback inference source for low-confidence slots. This supplements, rather than replaces, Typify's usage-driven analysis. CommandsAvailable from the Command Palette:
Tips
LinksThe full technical paper containing the technique description and evaluation results was published at the 34th IEEE/ACM International Conference on Program Comprehension (ICPC 2026), Rio de Janeiro, Brazil. Typify is a research project from the University of Windsor, supported by the Natural Sciences and Engineering Research Council of Canada (NSERC). |

