Registry / devops / typecoverage

typecoverage

JSON →
library1.0.1pypypi✓ verified 85d ago

A strict CLI + library API to report untyped variables, arguments, and function returns in Python code. Current version 1.0.1, supports Python >=3.11. Released as a stable tool for enforcing type coverage.

pip install typecoverage
INSTALL
IMPORT
SIG · TYPECOVERAGE
T
typecoverage
devopspythonv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TypeCoverage
from typecoverage import TypeCoverage

Parse a Python source string and get a coverage report of missing type annotations.

from typecoverage import TypeCoverage import ast code = """ def add(a, b): return a + b """ tree = ast.parse(code) tc = TypeCoverage() report = tc.report(tree) print(report) # Output: {}
Debug
Known issues
gotchaTypeCoverage.report() returns a dict with line numbers as keys. The dict may be empty if all functions have type annotations.
fix
Check if dict is empty before iterating.
affects: <=1.0.1
gotchaThe tool only analyzes a single AST; it does not traverse dependencies or installed packages. You must provide code as an AST.
fix
Use ast.parse() on your source code before passing to typecoverage.
affects: all
deprecatedNo deprecated features known in version 1.0.1.
affects: 1.0.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'typecoverage'
Package not installed in current environment.
fix
Run: pip install typecoverage
TypeError: report() missing 1 required positional argument: 'tree'
Calling report() without passing an AST object.
fix
Ensure you pass an AST node: tc.report(ast.parse(source))
Upgrade
Version history
1.0.1latest on PyPI · released Aug 18, 2025
Audit
Dependencies
astrequiredStandard library module for AST parsing; used internally.
Agent activity
6 hits · last 30 days
node
6
Resources