View the structure of Python classes and functions
Project description
objinspect
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 objinspect
>>> objinspect(math.pow)
Function(name='pow', parameters=2, description='Return x**y (x to the power of y).')
>>> objinspect(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"">"
}
]
>>> objinspect(objinspect)
Function(
name="objinspect",
parameters=2,
description="The objinspect 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
objinspect-0.2.5.tar.gz
(8.9 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.2.5.tar.gz
.
File metadata
- Download URL: objinspect-0.2.5.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59fd0e7c113ae9f265ecdee3eabf3874181d81b5196beb99498ca6182f0c54f5 |
|
MD5 | bfafcc4a3d885f7e494248845ebae9aa |
|
BLAKE2b-256 | 6e98d4225e9930a0357d42258190180d42f4b70d32180ef83d001c72d1c361be |
File details
Details for the file objinspect-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.2.5-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e616103d8ca77cf9a590c78c41a36e4145ce2f42aea18e3cfd2b942b80fd5a46 |
|
MD5 | d30a2c1ddae0d32ac42266f064992261 |
|
BLAKE2b-256 | b08668c6ac391149834b613a9681b094311c3bce29f79acba5549bd4a1adbb31 |