{ "info": { "author": "Saiyang Gou", "author_email": "gousaiyang223@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "# tbtrim\n\n[![PyPI - Downloads](https://pepy.tech/badge/tbtrim)](https://pepy.tech/count/tbtrim)\n[![PyPI - Version](https://img.shields.io/pypi/v/tbtrim.svg)](https://pypi.org/project/tbtrim)\n[![PyPI - Format](https://img.shields.io/pypi/format/tbtrim.svg)](https://pypi.org/project/tbtrim)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tbtrim.svg)](https://pypi.org/project/tbtrim)\n[![PyPI - Status](https://img.shields.io/pypi/status/tbtrim.svg)](https://pypi.org/project/tbtrim)\n![License](https://img.shields.io/github/license/gousaiyang/tbtrim.svg)\n\n`tbtrim` is a utility to trim Python traceback information. By assigning user-refined [`sys.excepthook`](https://docs.python.org/3/library/sys.html#sys.excepthook), one can easily customize the behavior after an exception is raise and uncaught, and just before the interpreter prints out the given traceback and exception to `sys.stderr`.\n\nIn a more human-readable way, `tbtrim` is to let you handle the last words of a program when it exits because of an exception.\n\n## Installation\n\nSimply run the following to install the current version from PyPI:\n\n```shell\n$ pip install tbtrim\n```\n\nOr install the latest version from the git repository:\n\n```shell\ngit clone https://github.com/gousaiyang/tbtrim.git\ncd tbtrim\npip install -e .\n# and to update at any time\ngit pull\n```\n\n## Usage\n\n> **set_trim_rule**(*predicate*, *target*=BaseException, *exception*=None, *strict*=False)\n\nSet the rule for trimming traceback (will set `sys.excepthook`).\n\nYou can determine whether to start to trim traceback items based on the filename.\n\n**Args:**\n\n- **predicate** (*function*): a function which takes one `str` parameter (the filename of a traceback item) and returns `bool` (returning `True` indicates that this traceback item and the following items should be trimmed)\n\n- **target** (*class_or_tuple*): a tuple may be given as an exception to check against if to apply the rule for trimming its traceback\n\n- **exception** (*class_or_tuple*): a tuple may be given as an exception to check against if to **NOT** apply the rule for trimming its traceback\n\n- **strict** (*bool*): indicate whether checking an exception against `target` and `exception` in a strict mode (setting `True` uses `is` to check; `False` uses `issubclass` to check)\n\n> **clear_trim_rule**()\n\nClear the rule for trimming traceback (restore the excepthook).\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/gousaiyang/tbtrim", "keywords": "traceback trim exception excepthook", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tbtrim", "package_url": "https://pypi.org/project/tbtrim/", "platform": "", "project_url": "https://pypi.org/project/tbtrim/", "project_urls": { "Homepage": "https://github.com/gousaiyang/tbtrim" }, "release_url": "https://pypi.org/project/tbtrim/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "A utility to trim Python traceback information.", "version": "0.2.1" }, "last_serial": 4879811, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c1909731a32385a7b2b93826f4fc091e", "sha256": "11b12062a515c410115958045ddf92f2b3b19b2b03cf3c00587b1799dde781dd" }, "downloads": -1, "filename": "tbtrim-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c1909731a32385a7b2b93826f4fc091e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 1669, "upload_time": "2019-01-22T14:25:26", "url": "https://files.pythonhosted.org/packages/c3/3f/e24d6b1a0fcb4ed7aaa811db5051f519d9deb0cbef13c1595af258d4a0f0/tbtrim-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a7190d4199d55d8b5ca6e10d222e314", "sha256": "2c5d69203b18ca7645356ada33215e27749bc948b5d99990b8f579448fc8dc4f" }, "downloads": -1, "filename": "tbtrim-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7a7190d4199d55d8b5ca6e10d222e314", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1554, "upload_time": "2019-01-22T14:25:29", "url": "https://files.pythonhosted.org/packages/6d/a6/feb72f3e7f236078115288b14882532762affae947aeeeaa8bc1b98d0ea7/tbtrim-0.1.0.tar.gz" } ], "0.1.0.post1": [ { "comment_text": "", "digests": { "md5": "dfd51b5285ed020f3a9f2659f14a07c5", "sha256": "36531ed1060b438e077220b1457e551022f7ad7cf847096f0708a91ff042895e" }, "downloads": -1, "filename": "tbtrim-0.1.0.post1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dfd51b5285ed020f3a9f2659f14a07c5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2550, "upload_time": "2019-01-23T03:55:49", "url": "https://files.pythonhosted.org/packages/38/07/b82dcbd44cdc63628befbf82b2d35ad86b6690e64b5f1383dfb0c71e7018/tbtrim-0.1.0.post1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ad1da41c73e7e969e3fb1458965e4e2", "sha256": "bd0203ea3b47f2f789c7e7ce5d15314f275c988be0baac66b25d1d907fc2bec6" }, "downloads": -1, "filename": "tbtrim-0.1.0.post1.tar.gz", "has_sig": false, "md5_digest": "1ad1da41c73e7e969e3fb1458965e4e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2184, "upload_time": "2019-01-23T03:55:51", "url": "https://files.pythonhosted.org/packages/ad/51/3ce537874cd712507258febc0f1aadbc50bbbbf7394121cc9a8cf0206350/tbtrim-0.1.0.post1.tar.gz" } ], "0.1.0.post2": [ { "comment_text": "", "digests": { "md5": "10e5193a78fb5512320dca028e1381d8", "sha256": "4a83bba6b0e71863a009365a563bfbb2539c732c5d4b4a4e3c617ddacf681e53" }, "downloads": -1, "filename": "tbtrim-0.1.0.post2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "10e5193a78fb5512320dca028e1381d8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3461, "upload_time": "2019-01-23T09:10:45", "url": "https://files.pythonhosted.org/packages/47/42/60a10d8033e285f7e6a77e83c4f3a660a1ecc84d5ae4f6cce13f75a410b6/tbtrim-0.1.0.post2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "467fd3fe4621df9acaec4fc681268524", "sha256": "58f5f06daa93b67112f551e5eef34a7d86e7f89af9296f552c5b653ddfbab9ed" }, "downloads": -1, "filename": "tbtrim-0.1.0.post2.tar.gz", "has_sig": false, "md5_digest": "467fd3fe4621df9acaec4fc681268524", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2309, "upload_time": "2019-01-23T09:10:47", "url": "https://files.pythonhosted.org/packages/68/e5/36ec02870b46e919f8f807964aa4771204766f14bfbc1e29f2b409b6f48e/tbtrim-0.1.0.post2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e45c459c80147f1562aceab113e032ea", "sha256": "4d8505a998b414d299edf978edae42c850d873dffe11cee11ea34688b5782561" }, "downloads": -1, "filename": "tbtrim-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e45c459c80147f1562aceab113e032ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3904, "upload_time": "2019-01-24T09:21:05", "url": "https://files.pythonhosted.org/packages/53/84/8ee38647b6fe54a10787067b5b0b5a0510f5511da2b723a394aa756cfb25/tbtrim-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8e0213be2b17458b606350daa8f6ba2", "sha256": "78115ce0499b87ac2315e377ba076ec464ef2fa479c2243e5be1bf7a5a4c2db1" }, "downloads": -1, "filename": "tbtrim-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b8e0213be2b17458b606350daa8f6ba2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2769, "upload_time": "2019-01-24T09:21:07", "url": "https://files.pythonhosted.org/packages/34/71/6c8f16a0773497d9bf601b8839b6ddac4e0a9af8ef4394110ecb80d5b648/tbtrim-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "08d6f042cfaf009e0131933061e796f8", "sha256": "860839d7296298a8823b3a0ac49a7f29424819d1481b5521329d339eac062bb9" }, "downloads": -1, "filename": "tbtrim-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "08d6f042cfaf009e0131933061e796f8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3915, "upload_time": "2019-02-28T15:37:12", "url": "https://files.pythonhosted.org/packages/40/44/a43122d939241a0c7eed4f26457888c66e7f788eda1077b2122e998ea004/tbtrim-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16f39aa85a9702cde95a96328b5aefdb", "sha256": "b0810edfb5dcf94c5fe3335a8a8e18ae38a411f6ff6afca188c66ac72444218f" }, "downloads": -1, "filename": "tbtrim-0.2.1.tar.gz", "has_sig": false, "md5_digest": "16f39aa85a9702cde95a96328b5aefdb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2794, "upload_time": "2019-02-28T15:37:14", "url": "https://files.pythonhosted.org/packages/5d/79/617749a3e689dbb741da15cf3134fd52a47e3227d878a48573ece71df043/tbtrim-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "08d6f042cfaf009e0131933061e796f8", "sha256": "860839d7296298a8823b3a0ac49a7f29424819d1481b5521329d339eac062bb9" }, "downloads": -1, "filename": "tbtrim-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "08d6f042cfaf009e0131933061e796f8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3915, "upload_time": "2019-02-28T15:37:12", "url": "https://files.pythonhosted.org/packages/40/44/a43122d939241a0c7eed4f26457888c66e7f788eda1077b2122e998ea004/tbtrim-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16f39aa85a9702cde95a96328b5aefdb", "sha256": "b0810edfb5dcf94c5fe3335a8a8e18ae38a411f6ff6afca188c66ac72444218f" }, "downloads": -1, "filename": "tbtrim-0.2.1.tar.gz", "has_sig": false, "md5_digest": "16f39aa85a9702cde95a96328b5aefdb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2794, "upload_time": "2019-02-28T15:37:14", "url": "https://files.pythonhosted.org/packages/5d/79/617749a3e689dbb741da15cf3134fd52a47e3227d878a48573ece71df043/tbtrim-0.2.1.tar.gz" } ] }