see: dir for humans
see is an alternative to dir(), for Python 2.6+ and 3.3+.
It neatly summarises what you can do with an object. Use it to inspect your code or learn new APIs.
Example
Say you have an object which you’d like to know more about:
>>> from datetime import timedelta
Try inspecting the object with see:
>>> see(timedelta)
isclass + -
* / //
% +obj -obj
< <= ==
!= > >=
abs() bool() dir()
divmod() hash() help()
repr() str() .days
.max .microseconds .min
.resolution .seconds .total_seconds()
Here we can discover some things about it, such as:
The object is a class.
You can add something to it with the + operator.
It has a seconds attribute.
It has a total_seconds attribute which is a function.
Compare with the output of dir:
>>> dir(timedelta) ['__abs__', '__add__', '__bool__', '__class__', '__delattr__', ' __dir__', '__divmod__', '__doc__', '__eq__', '__floordiv__', '__ format__', '__ge__', '__getattribute__', '__gt__', '__hash__', ' __init__', '__init_subclass__', '__le__', '__lt__', '__mod__', ' __mul__', '__ne__', '__neg__', '__new__', '__pos__', '__radd__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rf loordiv__', '__rmod__', '__rmul__', '__rsub__', '__rtruediv__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclassho ok__', '__truediv__', 'days', 'max', 'microseconds', 'min', 'res olution', 'seconds', 'total_seconds']
You can filter the results of see using a wildcard pattern or a regular expression:
>>> see(timedelta).filter('*sec*')
.microseconds .seconds .total_seconds()
>>> see(timedelta).filter('/^d/')
dir() divmod()
Documentation
Documentation is available at https://ljcooke.github.io/see/
Contributing
The source code is maintained on GitHub. Contributions are welcome.
Metadata
Release files for see 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| see-1.4.1.tar.gz | 17.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| see-1.4.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 30.0 kB
Release files / see-1.4.1.tar.gz
| Download URL | see-1.4.1.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14f8f8a88a909a7d7dea81f0016e3fdfabd3b5d335992e102a382e1a71672bd1
|
|
BLAKE2b-256 checksum How to use checksums |
fffcfcabb6a9bfe7c56798285839780cae67342256b823b97e94d862b0ba21d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / see-1.4.1-py2.py3-none-any.whl
| Download URL | see-1.4.1-py2.py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
378616d17ed7e0913701f7cb3ff3fc1c7c618da0f6a2144ce21f0d3c493ba0d2
|
|
BLAKE2b-256 checksum How to use checksums |
7d446d4f449ad9dbdeeb9e2d7ccf9114210f41636f589e1dc9700411531f1961
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |