Skip to content

View the structure of Python classes and functions

License

Notifications You must be signed in to change notification settings

zigai/objinspect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

objinspect

Tests PyPI version Supported versions Downloads license

View the structure of Python classes and functions.

Installation

From PyPi

pip install objinspect

From source

pip install git+https://github.com/zigai/objinspect

Example

>>> import math
>>> from objinspect import inspect
>>> inspect(math.pow)
Function(name='pow', parameters=2, description='Return x**y (x to the power of y).')

>>> inspect(math.pow).dict
[
   {
      "default":"<class""inspect._empty"">",
      "description":"None",
      "kind":"<_ParameterKind.POSITIONAL_ONLY":0>,
      "name":"x",
      "type":"<class""inspect._empty"">"
   },
   {
      "default":"<class""inspect._empty"">",
      "description":"None",
      "kind":"<_ParameterKind.POSITIONAL_ONLY":0>,
      "name":"y",
      "type":"<class""inspect._empty"">"
   }
]
                 
>>> inspect(inspect)
Function(
    name="inspect",
    parameters=2,
    description="The inspect function  takes an object and an optional include_inherited flag (defaults to True) and returns either a Function object or a Class object depending on the type of object.",
)

License

MIT License