Find Python types

Proprietary

Find type references by name. Identifies classes matching a type pattern. In Python, all type definitions use the class keyword, covering regular classes, abstract base classes, protocols, enums, dataclasses, named tuples, typed dicts, and more.

org.openrewrite.python.migrate.FindTypes

Required

A type name used to find matching type references. Can be a simple class name (e.g., OrderedDict) or a module-qualified name (e.g., collections.OrderedDict). Simple names match against the class name only, while qualified names match against the full module path. Supports glob expressions. collections..* finds every type from every submodule of the collections module.

Optional

checkAssignabilityBoolean

When enabled, find type references that are assignable to (i.e., subclasses of) the provided type.

mod run . --recipe=org.openrewrite.python.migrate.FindTypes \ -P typeName=OrderedDict

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.