{"id":13484246,"url":"https://github.com/laike9m/pdir2","last_synced_at":"2025-05-14T21:06:12.761Z","repository":{"id":38803979,"uuid":"83316119","full_name":"laike9m/pdir2","owner":"laike9m","description":"Pretty dir() printing with joy:beer:","archived":false,"fork":false,"pushed_at":"2024-10-10T17:00:41.000Z","size":2094,"stargazers_count":1329,"open_issues_count":14,"forks_count":47,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-05T15:21:31.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laike9m.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-27T13:58:20.000Z","updated_at":"2025-04-14T07:48:49.000Z","dependencies_parsed_at":"2022-07-27T15:49:56.348Z","dependency_job_id":"d7910a46-7257-4062-963a-439d84e373ee","html_url":"https://github.com/laike9m/pdir2","commit_stats":{"total_commits":190,"total_committers":18,"mean_commits":"10.555555555555555","dds":"0.21578947368421053","last_synced_commit":"780d1c98acb124e102d2e10d24a844192fd149f0"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2Fpdir2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2Fpdir2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2Fpdir2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2Fpdir2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laike9m","download_url":"https://codeload.github.com/laike9m/pdir2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254121257,"owners_count":22018132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:21.312Z","updated_at":"2025-05-14T21:06:12.678Z","avatar_url":"https://github.com/laike9m.png","language":"Python","readme":"# pdir2: Pretty dir() printing with joy\n\n![Build status](https://github.com/laike9m/pdir2/actions/workflows/ci.yml/badge.svg)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/pdir2.svg)](https://pypi.python.org/pypi/pdir2/)\n![PyPI Version](https://img.shields.io/pypi/v/pdir2.svg)\n\u003ca href=\"https://github.com/ambv/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\nHave you ever dreamed of a better output of `dir()`? I do. So I created this.\n\n![](https://github.com/laike9m/pdir2/raw/master/images/presentation_v2.gif)\n\n## Features\n\n-   Attributes are grouped by types/functionalities, with beautiful colors.\n\n-   Support color customization, [here's how](https://github.com/laike9m/pdir2/wiki/User-Configuration).\n\n-   Support all platforms including Windows(Thanks to [colorama](https://github.com/tartley/colorama)).\n\n-   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.\n\n-   The return value of `pdir()` can still be used as a list of names.\n\n-   ✨ Attribute searching\n\n    You can search for certain names with `.s()` or `.search()`:\n\n    ![](https://github.com/laike9m/pdir2/raw/master/images/search.gif)\n\n    Search is case-insensitive by default.\n     `search(name, case_sensitive=True)` does case-sensitive searching.\n\n-   :star2: Attribute filtering\n\n    `properties`: Find properties/variables defined in the inspected object.\n\n    `methods`: Find methods/functions defined in the inspected object.\n\n    `public`: Find public attributes.\n\n    `own`: Find attributes that are not inherited from parent classes.\n\n    These filters **can be chained!** Order does **NOT** matter.\n\n    For example, use `pdir(obj).public.own.methods` to find all public own methods.\n\n    You can also call `search` on the returned results.\n\n    See a [complete example](https://github.com/laike9m/pdir2/wiki/Attribute-Filtering).\n\n## Install\n\n### Generic\n\n    pip install pdir2\n\nAbout the name. I wanted to call it \"pdir\", but there's already one with this\nname on pypi. Mine is better, of course.\n\n### Fedora\n\n    dnf install python3-pdir2\n\n## Automatic Import\n\nAs a better alternative of `dir()`, it's more convenient to automatically import\npdir2 when launching REPL. Luckily, Python provides a way to do this. In you `.bashrc`(or `.zshrc`), add this line:\n\n    export PYTHONSTARTUP=$HOME/.pythonstartup\n\nThen, create `.pythonstartup` in your home folder. Add one line:\n\n    import pdir\n\nNext time you launch REPL, `pdir()` is already there, Hooray!\n\n## Development\n\n1. Set up development environment\n\n   - **PDM**: pdir2 uses [PDM](https://pdm.fming.dev/latest/) to manage dependencies, so you want to make sure it's installed.\n   - **pyenv**: Since you need to test pdir2 on multiple Python versions, [pyenv](https://github.com/pyenv/pyenv) is highly recommended. Make sure you have Python 3.8, 3.9, 3.10 and 3.11 installed.\n\n2. Install dev dependencies\n\n   Simply run `pdm install`.\n\n   If you want to work on a specific Python version, run `pdm use [PYTHON_VERSION]` first to switch PDM to that version (e.g. `pdm use 3.9` if you want to debug a Python 3.9 specific issue).\n\n\n3. Run tests\n\n   Run `pdm run tox`\n\nThe guide may be incomplete. Please file bugs if you encounter any issues.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaike9m%2Fpdir2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaike9m%2Fpdir2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaike9m%2Fpdir2/lists"}