Package: explor
explorPython object explorer which shows you what you can do with an object.It takes the output fromdir(), checks this and classifies it in a table.
With that, you don't have to read the entire output ofdir()and visually
filter it for the relevant information.InstallationInstall the package:pipinstallexplororpipinstallgit+git://github.com/Talon24/exploreorpipinstallgit+https://github.com/Talon24/exploreExampleFrom this# Very long line with very specific information, like all the dunder-methodsimportdatetimeprint(dir(datetime.datetime.now()))['__add__','__class__','__delattr__','__dir__','__doc__','__eq__','__format__','__ge__','__getattribute__','__gt__','__hash__','__init__','__init_subclass__','__le__','__lt__','__ne__','__new__','__radd__','__reduce__','__reduce_ex__','__repr__','__rsub__','__setattr__','__sizeof__','__str__','__sub__','__subclasshook__','astimezone','combine','ctime','date','day','dst','fold','fromisocalendar','fromisoformat','fromordinal','fromtimestamp','hour','isocalendar','isoformat','isoweekday','max','microsecond','min','minute','month','now','replace','resolution','second','strftime','strptime','time','timestamp','timetuple','timetz','today','toordinal','tzinfo','tzname','utcfromtimestamp','utcnow','utcoffset','utctimetuple','weekday','year']To thisfromexplorimportexploreaseximportdatetimeex(datetime.datetime.now())Inherits:
datetime -> date -> object
  Description:
datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

The year, month and day arguments are required. tzinfo may be None, or an
instance of a tzinfo subclass. The remaining arguments may be ints.
+ Class datetime --+-----------------------+------+
| Methods          | Data                  | Ops  |
+------------------+-----------------------+------+
| astimezone       | day: int              | !=   |
| combine          | fold: int             | +    |
| ctime            | hour: int             | -    |
| date             | max: datetime         | <    |
| dst              | microsecond: int      | <=   |
| fromisocalendar  | min: datetime         | ==   |
| fromisoformat    | minute: int           | >    |
| fromordinal      | month: int            | >=   |
| fromtimestamp    | resolution: timedelta | hash |
| isocalendar      | second: int           | str  |
| isoformat        | tzinfo: NoneType      |      |
| isoweekday       | year: int             |      |
| now              |                       |      |
| replace          |                       |      |
| strftime         |                       |      |
| strptime         |                       |      |
| time             |                       |      |
| timestamp        |                       |      |
| timetuple        |                       |      |
| timetz           |                       |      |
| today            |                       |      |
| toordinal        |                       |      |
| tzname           |                       |      |
| utcfromtimestamp |                       |      |
| utcnow           |                       |      |
| utcoffset        |                       |      |
| utctimetuple     |                       |      |
| weekday          |                       |      |
+------------------+-----------------------+------+UsageThe module's name isexploreand it provides a function calledexplore().
To simplify exploration, i'd recommend aliasing it as something short likeex.SettingsYou can change the style of the table. TheDoubleTableis the default, if the text viewer can't handle unicode,
then theAsciiTablemight be useful. Some examples to change the Table style:importexplorexplor.TABLETYPE=explor.terminaltables.AsciiTableexplor.TABLETYPE=explor.terminaltables.SingleTableexplor.TABLETYPE=explor.terminaltables.DoubleTableexplor.TABLETYPE=explor.terminaltables.GithubFlavoredMarkdownTableModulefromexploreimportexploraseximportpathlibex(pathlib)+ module: pathlib ------+---------------------+-----------------+
| Constants | Modules   | Functions           | Classes         |
+-----------+-----------+---------------------+-----------------+
| EBADF     | fnmatch   | urlquote_from_bytes | Path            |
| EINVAL    | functools |                     | PosixPath       |
| ELOOP     | io        |                     | PurePath        |
| ENOENT    | ntpath    |                     | PurePosixPath   |
| ENOTDIR   | os        |                     | PureWindowsPath |
| S_ISBLK   | posixpath |                     | Sequence        |
| S_ISCHR   | re        |                     | WindowsPath     |
| S_ISDIR   | sys       |                     | attrgetter      |
| S_ISFIFO  | warnings  |                     |                 |
| S_ISLNK   |           |                     |                 |
| S_ISREG   |           |                     |                 |
| S_ISSOCK  |           |                     |                 |
+-----------+-----------+---------------------+-----------------+Functionfromexplorimportexploreasexdefa_function(pos:int,/,both:float,untyped=4,*,kw_only:str="blue")->complex:"""Kinds of arguments."""ex(a_function)Description:
Kinds of arguments.
+ Function a_function -> complex --------------------+
| Argument | Default | Type  | Kind                  |
+----------+---------+-------+-----------------------+
| pos      | ---     | int   | positional-only       |
| both     | ---     | float | positional or keyword |
| untyped  | 4       | Any   | positional or keyword |
| kw_only  | 'blue'  | str   | keyword-only          |
+----------+---------+-------+-----------------------+ClassOn Classes (Not instances), the constructor is also printed.fromexplorimportexploreaseximportrequestsex(requests.Request)Inherits:
Request -> RequestHooksMixin -> object
  Description:
A user-created :class:`Request <Request>` object.
+ type: Request --+------+
| Functions       | Ops  |
+-----------------+------+
| deregister_hook | !=   |
| prepare         | <    |
| register_hook   | <=   |
|                 | ==   |
|                 | >    |
|                 | >=   |
|                 | hash |
|                 | str  |
+-----------------+------+
  Description:
A user-created :class:`Request <Request>` object.
...
+ Constructor -------+
| Argument | Default |
+----------+---------+
| method   | None    |
| url      | None    |
| headers  | None    |
| files    | None    |
| data     | None    |
| params   | None    |
| auth     | None    |
| cookies  | None    |
| hooks    | None    |
| json     | None    |
+----------+---------+fromexplorimportexploreaseximportfractionsex(fractions.Fraction)Inherits:
Fraction -> Rational -> Real -> Complex -> Number -> object
  Description:
This class implements rational numbers.
...
+ ABCMeta: Fraction ---------------+-----------------------+--------+
| Methods      | Functions         | Data                  | Ops    |
+--------------+-------------------+-----------------------+--------+
| from_decimal | as_integer_ratio  | denominator: property | !=     |
| from_float   | conjugate         | imag: property        | %      |
|              | limit_denominator | numerator: property   | *      |
|              |                   | real: property        | **     |
|              |                   |                       | +      |
|              |                   |                       | +()    |
|              |                   |                       | -      |
|              |                   |                       | -()    |
|              |                   |                       | /      |
|              |                   |                       | //     |
|              |                   |                       | <      |
|              |                   |                       | <=     |
|              |                   |                       | ==     |
|              |                   |                       | >      |
|              |                   |                       | >=     |
|              |                   |                       | abs    |
|              |                   |                       | divmod |
|              |                   |                       | float  |
|              |                   |                       | hash   |
|              |                   |                       | round  |
|              |                   |                       | str    |
+--------------+-------------------+-----------------------+--------+
  Description:
This class implements rational numbers.
...
+ Constructor +---------+-----------------------+
| Argument    | Default | Kind                  |
+-------------+---------+-----------------------+
| numerator   | 0       | positional or keyword |
| denominator | None    | positional or keyword |
| _normalize  | True    | keyword-only          |
+-------------+---------+-----------------------+Automatic importIf you have ipython, you can create a file in~/.ipython/profile_default/startup/that imports it,
it will then be available at the start of ipython.This can look like this:from explor import explore as ex
from explor import explore_signature as exs
from explor import explore_object as exo

get_ipython().magic("%autocall 1")  # With this, it's callable without parens; e.g. `ex os.path`More explanationhere.LimitationsThe library won't always work on some builtin objects likeprintor libraries written in c, e.g.numpy.array.