{ "info": { "author": "Pranjal Mittal", "author_email": "pranjal.mittal.ece10@iitbhu.ac.in", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 2" ], "description": "pdir: Selective, Pretty dir printing utlity for Python\n======================================================\n \ndir() is a very useful utility function in python for developers & debuggers,\nwhich returns a list of names comprising the attributes of the given object, \nand of attributes reachable from it. \nHowever, a lot many times all those names can be bugging.\n\nCase-1: Say you are really interested in knowing only the useful methods a Python \"list\" offers.\nAnd you do not like the unreadable, unfiltered mess resulting from using \"dir(list)\".\n\nCase-2: You really love the unix \"grep\" tool and you want something like that\nwhich allows you to regex filter the results of dir() in a simple call.\n\nThen pdir should be very useful for you. \nI wrote this bit because something like this is very helpful to me, who quickly needs a \nlist of only the important functions a namespace offers; likes reading clean pretty stuff;\nand really loves the unix \"grep\" utility.\n\nYour new dir() friends-\n\n* rdir - Regex based dir filtering utility (alternative reference: *rd*)\n* pdir - Pretty, convenient dir printing with help (alternative reference: *pd*)\n\n\nQuickstart\n==========\n\npdir\n----\n\nYou can use import the *pdir* function from pdir after installing this package,\nand consider it as your new dir() friend.\n\nAn example:\n\n.. code-block:: python\n\n >>> from pdir import pdir\n >>> pdir(list)\n ['append',\n 'count',\n 'extend',\n 'index',\n 'insert',\n 'pop',\n 'remove',\n 'reverse',\n 'sort']\n\nNow lets compare this with what dir(list) prints:\n\n.. code-block:: python\n\n >>> dir(list)\n ['__add__', '__class__', .........................................................\n ..................................................................................\n 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']\n\nSome of the elements are substituted with dots (...) here.\n\n**Wasn't the earlier one clean and better?**\n\npdir > v0.1 also ships with a help utility (alpha)\n\n.. code-block:: python\n\n >>> pdir(list,help=True)\n -append-\n L.append(object) -- append object to end- \n -count-\n L.count(value) -> integer -- return number of occurrences of value- \n -extend-\n L.extend(iterable) -- extend list by appending elements from the iterable-\n\n**pd** is the alternative reference to the pdir function explained above.\n\n.. code-block:: python\n\n >>> from pdir import pd\n >>> pd(list) # Is same as pdir used in the example before.\n\nrdir\n----\nHaving explained pdir, which should probably be the more convenient side of this package,\n**rdir** is the more powerful and useful component here.\nIt allows you to run a regex filter to restrict the names returned by dir.\n\n.. code-block:: python\n\n >>> from pdir import rdir\n >>> rdir(list,'in')\n ['__contains__', '__init__', 'index', 'insert']\n >>>\n >>> # The above shows a list of items that match the regex='in' filter. Very similar to the unix grep utility.\n >>>\n >>> # To get an inverse list (NOT matching regex) pass the *inv=True* parameter. keyword \"inv\" is optional.\n >>> rdir(list, '__',True)\n >>> ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']\n >>> # ^ returned a list without any '__' (underscores).\n\nThe *pdir* function is itself dependent on *rdir* in its internal usage.\n\nrdir -> \n* Does not pretty print by default and returns a list which can be assigned to another object.\n* To enable pretty printing, you have to disable return, by providing ret = False as an additional parameter.\n\n\n\nNotes\n=====\n\n * *pdir* is essentially a wrapper on *rdir*, which in itself is a wrapper around the Python *dir* function.\n * The code for this tool is available `here`_.\n * Would be glad to see anyone interested in contributing.\n * You can email me or leave an issue on github suggesting improvements.\n\n.. _here: https://github.com/pramttl/pdir", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pramttl/pdir", "keywords": "regex dir pretty namespaces", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "pdir", "package_url": "https://pypi.org/project/pdir/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pdir/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/pramttl/pdir" }, "release_url": "https://pypi.org/project/pdir/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "A Selective,Pretty dir printing utility for Python.", "version": "0.2.2" }, "last_serial": 815280, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "940b8d6de96267578e469213b85d4d93", "sha256": "05d2c68f32a5f6f246f61477f2c0497e88fb7b9a7d66a37ec2f5bd4e81e27868" }, "downloads": -1, "filename": "pdir-0.1.tar.gz", "has_sig": false, "md5_digest": "940b8d6de96267578e469213b85d4d93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2033, "upload_time": "2013-07-13T22:41:45", "url": "https://files.pythonhosted.org/packages/f9/3e/17a108d29822a58469306ec3f4babb8472b8358a210e9eb02ea2695044ad/pdir-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "aee9887e099351b7cba1ffa1f0927a80", "sha256": "8277fa81c25669a7e7548df080ebf06e6f682b48ea0e22a6511d8560ffbb242b" }, "downloads": -1, "filename": "pdir-0.2.tar.gz", "has_sig": false, "md5_digest": "aee9887e099351b7cba1ffa1f0927a80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3990, "upload_time": "2013-07-14T11:48:13", "url": "https://files.pythonhosted.org/packages/7e/d8/e01b41900637386d3c11da138c3eb9a0315697252ebba9f4a58b0ff1ae11/pdir-0.2.tar.gz" } ], "0.2.1": [], "0.2.2": [ { "comment_text": "", "digests": { "md5": "e47b5d74296f46c1dbe0e36f84b7355e", "sha256": "43e7fdd73807b17c58f548db04eabba8cbea4033582a42b9d3c98ceda1fbfffb" }, "downloads": -1, "filename": "pdir-0.2.2.tar.gz", "has_sig": false, "md5_digest": "e47b5d74296f46c1dbe0e36f84b7355e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4150, "upload_time": "2013-07-14T20:15:49", "url": "https://files.pythonhosted.org/packages/0d/ab/145dea39b17df17c86fbb40285e22a27c9f7b856077c4d81225a552e25e2/pdir-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e47b5d74296f46c1dbe0e36f84b7355e", "sha256": "43e7fdd73807b17c58f548db04eabba8cbea4033582a42b9d3c98ceda1fbfffb" }, "downloads": -1, "filename": "pdir-0.2.2.tar.gz", "has_sig": false, "md5_digest": "e47b5d74296f46c1dbe0e36f84b7355e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4150, "upload_time": "2013-07-14T20:15:49", "url": "https://files.pythonhosted.org/packages/0d/ab/145dea39b17df17c86fbb40285e22a27c9f7b856077c4d81225a552e25e2/pdir-0.2.2.tar.gz" } ] }