{ "info": { "author": "liwt31", "author_email": "liwt31@163.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development" ], "description": "# dual_vector_foil\n[![Build Status](https://travis-ci.org/liwt31/dual_vector_foil.svg?branch=master)](https://travis-ci.org/liwt31/dual_vector_foil)\n[![PyPI version](https://badge.fury.io/py/dvf.svg)](https://badge.fury.io/py/dvf)\n\nA dual vector foil\uff08[\u4e8c\u5411\u7b94](https://zh.wikipedia.org/wiki/%E4%B8%89%E4%BD%93%E7%94%A8%E8%AF%AD%E5%88%97%E8%A1%A8#%E4%BA%8C%E5%90%91%E7%AE%94)\uff09 that squashes any Python objects into your console\n\n## Introduction\n\nSimply speaking, `dvf` (dual vector foil) is a recursive pretty printer for any objects in Python. It allows you to inspect Python object in a simple and comprehensive way. Checkout the following example:\n\n![simple2](https://user-images.githubusercontent.com/22628546/48036479-9295a680-e1a3-11e8-9847-449d3e5310ae.gif)\n\n## Example on Flask app\n\n`Flask` app is very complex Python object, and `dvf` can use paging (`less`) to wrap the output. If the GIF doesn't show immediately, be patient, it's about 10 MB large (click to zoom in):\n\n![complex4](https://user-images.githubusercontent.com/22628546/47995242-9851a480-e12f-11e8-9e2d-499756b3fdb4.gif)\n\nIf your eyes are sharp enough, you'll find a warning at the end of the gif. That's because `dvf` tries to access some attributes of `Flask` that are only valid in a request context. The warning is quite common for complex objects.\n\n## Installation \n\n```\npip install dvf\n```\n\nThe project is still under development, so any report on bugs is highly appreciated. \nThe development is under Python 3.7 and Python 3.6 is also tested. The package provides **no Python <= 3.5 support**.\n\n## Philosophy\n\n#### Why not `dir` or `__dict__`\n\nThere is already an amazing inspection package [`pdir`](https://github.com/laike9m/pdir2), which emphasize on the **usage** of modules and objects, while `dvf` is aiming at **data and internal structure** of objects. \nAs a result, `dvf` will by default omit any object attributes that have type of function, module or class, and will try its best to expand any iterable to see what really lies in .\n\n#### Safety concern\nAs you might have gaused, it's not wise to use `dvf` on untrusted object because `dvf` will have to evoke some methods of the object to evaluate attributes. Is this a foundamental flaw of `dvf`? I think not.\nBecause if an object is really malicious, it can delete your system when it's imported, why wait untill `dvf` to check it?\n\n#### Deal with loops\nThe biggest problem of `dvf` is loops in objects. The following class has a pointer points to himself. A simple recursion implementation of `dvf` will result in an infinite loop.\n```python\nclass Foo:\n\n def __init__(self):\n self.another_me = self\n```\nTo solve this economically, `dvf` records every object it has visited and omit them next time it meet the object. That's why sometimes a complete view of certain objects is not possible.\n\nAnother troublesome case is object creation during attribute access. A typical example is `NumPy` array, which has an attribute of `T` that returns the transpose of the array, \nwhich has another `T` that returns another new array. So there is also an infinite loop. To solve this `dvf` should be very cautious toward data descriptors. Some result gained from descriptors will not be expanded.\n\n## Todo list\n- [ ] User-custom searching and filtering\n- [ ] Docs on output format\n- [x] Tests\n- [ ] Use `prompt_toolkit` to build an application that can handle wide output (horizontally scollable)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/liwt31/dual_vector_foil", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "dvf", "package_url": "https://pypi.org/project/dvf/", "platform": "", "project_url": "https://pypi.org/project/dvf/", "project_urls": { "Homepage": "https://github.com/liwt31/dual_vector_foil" }, "release_url": "https://pypi.org/project/dvf/0.1.2/", "requires_dist": [ "print-tree2", "colorama", "termcolor" ], "requires_python": "", "summary": "A dual vector foil (\u4e8c\u5411\u7b94) that squashes any Python objects into your console.", "version": "0.1.2" }, "last_serial": 4488504, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2d6fdd7044d642da0beecc6f561b4faa", "sha256": "379dedd01e6c71700084b33f3b0b088e62b1948bc5f49f2a359c9995ea0a5122" }, "downloads": -1, "filename": "dvf-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2d6fdd7044d642da0beecc6f561b4faa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9144, "upload_time": "2018-11-05T13:41:17", "url": "https://files.pythonhosted.org/packages/33/9e/07cd29b5ec77f88b48f597010800cf4050b5e22e6245f966fc5633408f28/dvf-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bda9455450609581aa9ae1d0c4d0e891", "sha256": "7b5ca82393a2c0f642644a7be7fe1ce7d3c9765aaa82b1cf1c67019254516e73" }, "downloads": -1, "filename": "dvf-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bda9455450609581aa9ae1d0c4d0e891", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6920, "upload_time": "2018-11-05T13:41:19", "url": "https://files.pythonhosted.org/packages/a5/d9/cb753e0395d274f34ae76393845655c0e1d982c58b2e02d0ed45efbe1122/dvf-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "84a0d185ac7754d923e86ce52d4154e0", "sha256": "b52635fd35d044a6a9decb1411dd3ad8496add44503af4ce4723b0bb2630ee09" }, "downloads": -1, "filename": "dvf-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "84a0d185ac7754d923e86ce52d4154e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9176, "upload_time": "2018-11-05T13:44:31", "url": "https://files.pythonhosted.org/packages/c2/e5/22e3d37e991ac3afa7f7acce33ea219f696e7e40107809e5b60afbfb2d42/dvf-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16b6b8702bd6b6f2f9866d0e68dfe39a", "sha256": "70b7b5e7acd8d322b05966ddae5ef1aa565058e94e6a062402ce8e160ecc362e" }, "downloads": -1, "filename": "dvf-0.1.1.tar.gz", "has_sig": false, "md5_digest": "16b6b8702bd6b6f2f9866d0e68dfe39a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6974, "upload_time": "2018-11-05T13:44:33", "url": "https://files.pythonhosted.org/packages/44/af/5c0d9b977f2f27184cd50e1fd9d656df763766aed57dea2d9a6b8aa56b95/dvf-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "913f2a89c88ae2046689b62e95050cf6", "sha256": "3cd4437c38d0e5057e900688eaa064ac5f38403bf9f35075ffcdfc7b45946dad" }, "downloads": -1, "filename": "dvf-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "913f2a89c88ae2046689b62e95050cf6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9613, "upload_time": "2018-11-15T06:16:16", "url": "https://files.pythonhosted.org/packages/49/4e/e1db09d064e98c7e81cc80748aa735df9de504a33a7c8ebaac23afe243c9/dvf-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4491e99ec26ba9ced26914b8ac983bc", "sha256": "8123f66e09195c822e404392388fbe62fe3fa902f819417d6832cd937ad6a738" }, "downloads": -1, "filename": "dvf-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d4491e99ec26ba9ced26914b8ac983bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7874, "upload_time": "2018-11-15T06:16:18", "url": "https://files.pythonhosted.org/packages/38/5d/4135e30662d5efcf270ce7d419d9a1fba4bb22163a23cc4bd5ba4deae321/dvf-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "913f2a89c88ae2046689b62e95050cf6", "sha256": "3cd4437c38d0e5057e900688eaa064ac5f38403bf9f35075ffcdfc7b45946dad" }, "downloads": -1, "filename": "dvf-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "913f2a89c88ae2046689b62e95050cf6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9613, "upload_time": "2018-11-15T06:16:16", "url": "https://files.pythonhosted.org/packages/49/4e/e1db09d064e98c7e81cc80748aa735df9de504a33a7c8ebaac23afe243c9/dvf-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4491e99ec26ba9ced26914b8ac983bc", "sha256": "8123f66e09195c822e404392388fbe62fe3fa902f819417d6832cd937ad6a738" }, "downloads": -1, "filename": "dvf-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d4491e99ec26ba9ced26914b8ac983bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7874, "upload_time": "2018-11-15T06:16:18", "url": "https://files.pythonhosted.org/packages/38/5d/4135e30662d5efcf270ce7d419d9a1fba4bb22163a23cc4bd5ba4deae321/dvf-0.1.2.tar.gz" } ] }