Skip to main content

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.

Features

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

  • Support all platforms including Windows(Thanks to colorama).

  • Support ipython, ptpython, bpython and Jupyter Notebook! See wiki for more information.

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

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

Search is case-insensitive by default.
You can use .search(name, case_sensitive=True) to do case sensitive searching.

Install

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.

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.

Release History

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)

Metadata

Release files for pdir2 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdir2 0.1.4
File Size Uploaded Provenance
pdir2-0.1.4.tar.gz 8.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pdir2 0.1.4
File Interpreter ABI Platform
pdir2-0.1.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 18.9 kB

Release files / pdir2-0.1.4.tar.gz

Download URL pdir2-0.1.4.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cae06821bc3efff5b1de7662bac03ba0ae3f1a95c53fd4bfe856a5653175ad29
BLAKE2b-256 checksum
How to use checksums
89cc6750af461926a073fcbc202338c8fd53db4cc65847b03cc7e1ed2867fc36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pdir2-0.1.4-py2.py3-none-any.whl

Download URL pdir2-0.1.4-py2.py3-none-any.whl
Size 10.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
abd9beb343376e1e54bf73d521a4dc48fa40fb525e136ddc65af5d6ac7e49ed3
BLAKE2b-256 checksum
How to use checksums
45d4081bd6b3d09e5f5648722232c0b58668df8b661ae5d24a63a118891fe92f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pdir2 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page