Python pyclbr Module
Example
Inspect a module’s classes without importing it:
import pyclbr
for x in pyclbr.readmodule_ex('email'):
print(x)
Try it Yourself »
Definition and Usage
The pyclbr module reads Python source to find classes and functions without executing the code.
Use it to power a class browser or to do lightweight static inspection safely.
Members
Member | Description |
---|---|
Class | Descriptor for a discovered class (name, file, methods, etc.). |
Function | Descriptor for a discovered function (name, file, etc.). |
readmodule() | Return a mapping for a module’s top-level classes and functions. |
readmodule_ex() | Like readmodule() , but supports packages and submodules. |