{ "info": { "author": "Malcom Gilbert", "author_email": "malcomgilbert@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "pydebug\n=======\n\nTiny python debugging utility modeled after visionmedia's node.js debug\nmodule and the python 3 print function\n\nInstallation\n------------\n\n::\n\n $ python setup.py install\n\nUsage\n-----\n\nWith ``debug`` you simply invoke the exported function to generate your\ndebug function, passing it a name which will determine if a noop\nfunction is returned, or custom decorated function that emulates the\npython 3 ``print`` function but, by default, prints to ``sys.stderr``. A\nunique color is selected per-function for visibility.\n\nExample *test.py*:\n\n.. code:: py\n\n import pydebug\n import time\n\n # \n # pydebug.debug(name)\n #\n # once you have initialized the debug module you can call it as shown below\n #\n # debug(*objects, sep=' ', end='\\n', file=sys.stderr, flush=False)\n #\n\n debug = pydebug.debug(\"test\")\n debug(\"hi there2\")\n\n debug2 = pydebug.debug(\"test2\")\n debug2(\"awesome\")\n\n debug({\"awesome\": True}, True, 1, \"test\")\n debug([], {1,2,3}, {\"awesome\": True}, True, 1, \"test\")\n\n time.sleep(0.1)\n debug('should be milliseconds now')\n\n time.sleep(1)\n debug('should be seconds now')\n\nThe **DEBUG** environment variable is then used to enable these based on\nspace or comma-delimited names. Here are some examples:\n\n::\n\n $ DEBUG=* python test_pydebug.py\n $ DEBUG=test python test_pydebug.py\n $ DEBUG=test2 python test_pydebug.py\n $ DEBUG=test* python test_pydebug.py\n\nMicrosecond diff\n----------------\n\nWhen actively developing an application it can be useful to see when the\ntime spent between one ``debug()`` call and the next. Suppose for\nexample you invoke ``debug()`` before requesting a resource, and after\nas well, the \"+NNNus\" will show you how much time was spent between\ncalls.\n\nWhen File is not a TTY\n----------------------\n\nWhen the file is not a TTY, ``to_utc_string()`` is called which mimicks\nthe default behavior of the Javascript ``Date#toUTCString()`` method\nused in the node.js debug module, making it more useful for logging the\ndebug information as shown below\n\n::\n\n $ DEBUG=* python test_pydebug.py 2>&1 | grep test\n $ DEBUG=* python test_pydebug.py 2>&1 | grep test2\n\nConventions\n-----------\n\nIf you're using this in one or more of your libraries, you *should* use\nthe name of your library so that developers may toggle debugging as\ndesired without guessing names. If you have more than one debuggers you\n*should* prefix them with your library name and use \":\" to separate\nfeatures. For example \"bodyParser\" from Connect would then be\n\"connect:bodyParser\".\n\nWildcards\n---------\n\nThe \"\\*\" character may be used as a wildcard. Suppose for example your\nlibrary has debuggers named \"connect:bodyParser\", \"connect:compress\",\n\"connect:session\", instead of listing all three with\n``DEBUG=connect:bodyParser,connect.compress,connect:session``, you may\nsimply do ``DEBUG=connect:*``, or to run everything using this module\nsimply use ``DEBUG=*``.\n\nYou can also exclude specific debuggers by prefixing them with a \"-\"\ncharacter or whitespace. For example:\n\n::\n\n $ DEBUG=test2,-test python test_pydebug.py\n $ DEBUG=\"test2 -test\" python test_pydebug.py\n\nLicense\n-------\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Malcom Gilbert\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "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/mjgil/pydebug", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pydebug", "package_url": "https://pypi.org/project/pydebug/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pydebug/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mjgil/pydebug" }, "release_url": "https://pypi.org/project/pydebug/1.0.3/", "requires_dist": null, "requires_python": null, "summary": "Tiny python debugging utility modeled after visionmedia's node.js debug module", "version": "1.0.3" }, "last_serial": 893383, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "5e8f6735f7f514a3fc812931322812c7", "sha256": "d2e714a2847fd253b7fd228fffd81ac466b856a9d2abf9fc169017732cd611c1" }, "downloads": -1, "filename": "pydebug-1.0.tar.gz", "has_sig": false, "md5_digest": "5e8f6735f7f514a3fc812931322812c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2804, "upload_time": "2013-10-13T12:16:49", "url": "https://files.pythonhosted.org/packages/90/cd/7627fbb807d312e937d2f15b1dd2047c4f74d02ae0507dba1fc7443f09da/pydebug-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "506a13d4628f64ef54de8553e930a35d", "sha256": "925f05945007591137c08a579c4c222ff961b6a134a6745531a7972f21134596" }, "downloads": -1, "filename": "pydebug-1.0.1.tar.gz", "has_sig": false, "md5_digest": "506a13d4628f64ef54de8553e930a35d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4250, "upload_time": "2013-10-13T13:16:32", "url": "https://files.pythonhosted.org/packages/f2/ac/d0e6f10f587a75f5fd7edfcf96a5fc14a0d66440a4a45ffcfe14d0fe0b0c/pydebug-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "ff6dba617a5e5c6032a25ba99cfb6d18", "sha256": "b948051fdad88e6ca7706839db9526b22d160fc2e58aef7e562c3005e0892bba" }, "downloads": -1, "filename": "pydebug-1.0.2.tar.gz", "has_sig": false, "md5_digest": "ff6dba617a5e5c6032a25ba99cfb6d18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4261, "upload_time": "2013-10-13T13:33:23", "url": "https://files.pythonhosted.org/packages/7f/ca/04af46e42aaaf7637e37a19baa03fc7b58f2aa932a7a997bc0eb3a80040e/pydebug-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "c36df396ecb9dd0c1495758bacf73692", "sha256": "d81094bf93943614acaad413ee0b4fda77d721b81a90856668a41a0ff0e401c1" }, "downloads": -1, "filename": "pydebug-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c36df396ecb9dd0c1495758bacf73692", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4330, "upload_time": "2013-10-13T14:01:55", "url": "https://files.pythonhosted.org/packages/5b/7a/161dfb5bb88e8ee49851e43e1ab0fe5c71a56285cf4bbb82b08035f45f59/pydebug-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c36df396ecb9dd0c1495758bacf73692", "sha256": "d81094bf93943614acaad413ee0b4fda77d721b81a90856668a41a0ff0e401c1" }, "downloads": -1, "filename": "pydebug-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c36df396ecb9dd0c1495758bacf73692", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4330, "upload_time": "2013-10-13T14:01:55", "url": "https://files.pythonhosted.org/packages/5b/7a/161dfb5bb88e8ee49851e43e1ab0fe5c71a56285cf4bbb82b08035f45f59/pydebug-1.0.3.tar.gz" } ] }