Readable information for real people.
Project description
Helping
As my girlfriend's cat likes to say while knocking over my drink: "I'm HELPING!"
This library is dedicated to providing helpful information about Python objects. It's useful for everyone, but especially dedicated to those learning how to program.
This library is the result of teaching Python to thousands of students.
Over time I found that the built-in dir()
function was actively confusing
to people learning Python, and I developed this library to help the students.
Then I found myself using it for my own coding.
That's when I knew I had something worthwhile.
The goal is "Readable information for real people."
Installation
Run this command (note that Python 3.6 or greater is required):
pip install helping
info()
The primary method is helping.info()
, which provides a readable summary of
an object. It separates out the methods, attributes, classes, and exceptions,
and perhaps most importantly, doesn't show private items unless requested.
If you call this without arguments, it provides info about the built-in Python functions, classes, and exceptions.
To see private items, pass the argument private=True
.
By default the items are listed vertically, which I've found to be most readable.
If you'd like a more compact form, pass compact=True
.
Here is the output from calling helping.info(int)
:
int (<class 'type'>)
methods:
bit_length()
conjugate()
from_bytes()
to_bytes()
attributes:
denominator
imag
numerator
real
Here is the output from calling helping.info()
:
builtins (<class 'module'>)
methods:
abs()
all()
any()
ascii()
bin()
breakpoint()
callable()
chr()
compile()
copyright()
credits()
delattr()
dir()
divmod()
eval()
exec()
exit()
format()
getattr()
globals()
hasattr()
hash()
help()
hex()
id()
input()
isinstance()
issubclass()
iter()
len()
license()
locals()
max()
min()
next()
oct()
open()
ord()
pow()
print()
quit()
repr()
round()
setattr()
sorted()
sum()
vars()
classes:
BaseException
bool
bytearray
bytes
classmethod
complex
dict
enumerate
filter
float
frozenset
GeneratorExit
int
KeyboardInterrupt
list
map
memoryview
object
property
range
reversed
set
slice
staticmethod
str
super
SystemExit
tuple
type
UnicodeDecodeError
UnicodeEncodeError
UnicodeTranslateError
zip
attributes:
Ellipsis
NotImplemented
exceptions:
ArithmeticError
AssertionError
AttributeError
BlockingIOError
BrokenPipeError
BufferError
BytesWarning
ChildProcessError
ConnectionAbortedError
ConnectionError
ConnectionRefusedError
ConnectionResetError
DeprecationWarning
EnvironmentError
EOFError
Exception
FileExistsError
FileNotFoundError
FloatingPointError
FutureWarning
ImportError
ImportWarning
IndentationError
IndexError
InterruptedError
IOError
IsADirectoryError
KeyError
LookupError
MemoryError
ModuleNotFoundError
NameError
NotADirectoryError
NotImplementedError
OSError
OverflowError
PendingDeprecationWarning
PermissionError
ProcessLookupError
RecursionError
ReferenceError
ResourceWarning
RuntimeError
RuntimeWarning
StopAsyncIteration
StopIteration
SyntaxError
SyntaxWarning
SystemError
TabError
TimeoutError
TypeError
UnboundLocalError
UnicodeError
UnicodeWarning
UserWarning
ValueError
Warning
ZeroDivisionError
functions()
Shows any functions defined in the script, and all built-in Python functions.
methods()
Shows just the methods of the specified object.
attributes()
Shows just the attributes of the specified object.
classes()
Shows just the classes belonging to the specified object.
exceptions()
Shows just the exceptions belonging to the specified object.
Logo by Ericatures
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file helping-0.0.5.tar.gz
.
File metadata
- Download URL: helping-0.0.5.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75e00048211218e472efa2c5d926bd6f87d3d7e5dff28ded2cd084e88378ee44 |
|
MD5 | 9a76876b227cd5e79e5be92d1dcfd6d7 |
|
BLAKE2b-256 | 32a7ad2995fd62114b36dac218e14b9353f20bb650bb6b66a8dfbf3bf9b9bc23 |
File details
Details for the file helping-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: helping-0.0.5-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88fa5e527075d217fcba061dea99da605a5ffee73be333593df5d2dbf3645863 |
|
MD5 | 23a2bece8d880dfedf9fe46e4feea132 |
|
BLAKE2b-256 | b765ad81012a6e3a90655dd382dc778cfd6f817d57cef794784b2f7022a567ff |