Metadata-Version: 2.0
Name: pdir2
Version: 0.3.0
Summary: Pretty dir printing with joy
Home-page: http://github.com/laike9m/pdir2
Author: laike9m
Author-email: laike9m@gmail.com
License: MIT License
Description-Content-Type: UNKNOWN
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Dist: colorama; platform_system == "Windows"
Requires-Dist: enum34; python_version < "3.4"

pdir2: Pretty dir() printing with joy
=====================================

|Build Status| |Supported Python versions| |PyPI Version|

Have you ever dreamed of a better output of ``dir()``? I do. So I
created this.

.. figure:: https://github.com/laike9m/pdir2/raw/master/images/presentation_v2.gif
   :alt: 

Features
--------

-  Attributes are grouped by types/functionalities, with beautiful
   colors.

-  Support color customization, `here's
   how <https://github.com/laike9m/pdir2/wiki/User-Configuration>`__.

-  Support all platforms including Windows(Thanks to
   `colorama <https://github.com/tartley/colorama>`__).

-  Support `ipython <https://github.com/ipython/ipython>`__,
   `ptpython <https://github.com/jonathanslenders/ptpython>`__,
   `bpython <https://www.bpython-interpreter.org/>`__ and `Jupyter
   Notebook <http://jupyter.org/>`__! See
   `wiki <https://github.com/laike9m/pdir2/wiki/REPL-Support>`__ for
   details.

-  The return value of ``pdir()`` can still be used as a list of names.

-  ✨ Attribute searching

You can search for certain names with ``.s()`` or ``.search()``:

.. figure:: https://github.com/laike9m/pdir2/raw/master/images/search.gif
   :alt: 

| Search is case-insensitive by default.
| ``search(name, case_sensitive=True)`` does case sensitive searching.

-  :star2: Attribute filtering

``properties``: Find properties/variables defined in the inspected
object.

``methods``: Find methods/functions defined in the inspected object.

``public``: Find public attributes.

``own``: Find attributes that are not inherited from parent classes.

These filters **can be chained!** Order does **NOT** matter.

For example, use ``pdir(obj).public.own.methods`` to find all public own
methods.

You can also call ``search`` on the returned results.

See a `complete
example <https://github.com/laike9m/pdir2/wiki/Attribute-Filtering>`__.

​

Install
-------

Generic
~~~~~~~

::

    pip install pdir2

About the name. I wanted to call it "pdir", but there's already one with
this name on pypi. Mine is better, of course.

Fedora
~~~~~~

::

    dnf install python3-pdir2
    --or--
    dnf install python2-pdir2

Automatic Import
----------------

As a better alternative of ``dir()``, it's more convenient to
automatically import pdir2 when launching REPL. Luckily, Python provides
a way to do this. In you ``.bashrc``\ (or ``.zshrc``), add this line:

::

    export PYTHONSTARTUP=$HOME/.pythonstartup

Then, create ``.pythonstartup`` in your home folder. Add one line:

::

    import pdir

Next time you launch REPL, ``pdir()`` is already there, Hooray!

Testing
-------

Simply run ``pytest``, or use ``tox`` if you like.

.. |Build Status| image:: https://travis-ci.org/laike9m/pdir2.svg
   :target: https://travis-ci.org/laike9m/pdir2
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/pdir2.svg
   :target: https://pypi.python.org/pypi/pdir2/
.. |PyPI Version| image:: https://img.shields.io/pypi/v/pdir2.svg



Release History
===============

0.3.0(2018-02-10)
-----------------

-  Add support for various filters (#37)

0.2.0(2017-04-04)
-----------------

-  Add support for color customization. (#14)

0.1.0(2017-03-16)
-----------------

-  Add support for ipython, ptpython and bpython (#4)

0.0.2(2017-03-11)
-----------------

API Changes (Backward-Compatible)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-  Added a ``case_sensitive`` parameter into the ``search`` function
   (#5)

Bugfixes
~~~~~~~~

-  Error calling pdir(pandas.DataFrame) (#1)
-  Methods are now considered functions (#6)


