{ "info": { "author": "Kirill Bulygin", "author_email": "kirill.bulygin@gmail.com", "bugtrack_url": null, "classifiers": [], "description": ".. This file is generated. DO NOT EDIT IT.\n.. code-block:: python\n\n # pip install withstopwatch\n # >>> from withstopwatch import Stopwatch\n\n Basic usage:\n >>> with Stopwatch():\n ... print('')\n \n 0 ms\n\n Using fields:\n >>> with Stopwatch() as s:\n ... pass\n 0 ms\n >>> assert isinstance(s.label, str) and s.label == '0 ms'\n >>> assert isinstance(s.ms, int) and s.ms == 0\n >>> assert isinstance(s.s, int) and s.s == 0\n >>> assert isinstance(s.seconds, float) and s.seconds > 0\n >>> assert isinstance(s.timedelta, datetime.timedelta)\n >>> assert isinstance(s.start, datetime.datetime)\n >>> assert isinstance(s.stop, datetime.datetime)\n\n `str` and `repr`:\n >>> assert str(s) == s.label\n >>> repr(s) # doctest: +ELLIPSIS\n ''\n\n Silence options:\n >>> with Stopwatch(template=None) as s:\n ... pass\n >>> assert s.label is None\n >>> with Stopwatch(file=None) as s:\n ... pass\n >>> assert s.label == '0 ms'\n\n With different templates:\n >>> with Stopwatch(template='passing'):\n ... pass\n 0 ms: passing\n >>> with Stopwatch('passing'):\n ... pass\n 0 ms: passing\n >>> with Stopwatch('{ms} ms'):\n ... pass\n 0 ms\n >>> with Stopwatch('{s} s'):\n ... pass\n 0 s\n >>> with Stopwatch('{:.03f} (i.e. {seconds:.03f})'):\n ... pass\n 0.000 (i.e. 0.000)\n >>> with Stopwatch('{timedelta}'):\n ... pass # doctest: +ELLIPSIS\n 0:00:00.000...\n >>> with Stopwatch('from {start!r} to {stop!r}') as s:\n ... pass # doctest: +ELLIPSIS\n from datetime.datetime(...) to datetime.datetime(...)\n >>> assert s.stop - s.start == s.timedelta\n\n With an exception (note: due to limitations of `doctest`, we can't check\n easily both that something is printed and that an exception is raised):\n >>> with Stopwatch(file=None):\n ... raise Exception()\n Traceback (most recent call last):\n Exception\n >>> try:\n ... with Stopwatch() as s:\n ... raise Exception()\n ... except Exception as exc:\n ... print(repr(s)) # doctest: +ELLIPSIS\n 0 ms (failed)\n \n >>> try:\n ... with Stopwatch('abc') as s:\n ... raise Exception()\n ... except Exception as exc:\n ... print(repr(s)) # doctest: +ELLIPSIS\n 0 ms: abc (failed)\n \n\n Testing with `time.sleep` (note: the tests may fail during a slower run):\n >>> import time\n >>> with Stopwatch() as s:\n ... time.sleep(0.1)\n 100 ms\n >>> assert 0.1 < s.seconds < 0.2\n\n Embedded stopwatchs:\n >>> with Stopwatch('outer'):\n ... with Stopwatch('inner'):\n ... pass\n 0 ms: inner\n 0 ms: outer\n\n Measuring the overhead of Stopwatch using Stopwatch itself\n (note: the tests may fail during a slower run):\n >>> with Stopwatch(file=None) as s1:\n ... with Stopwatch('inner') as s2:\n ... pass\n 0 ms: inner\n >>> with Stopwatch(file=None) as s3:\n ... pass\n >>> overhead = s1.seconds - s3.seconds\n >>> assert 0 <= overhead < 0.0001\n ... # ~20 us on i5@2.60GHz, Python 3.6.0, Linux", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "withstopwatch", "package_url": "https://pypi.org/project/withstopwatch/", "platform": "", "project_url": "https://pypi.org/project/withstopwatch/", "project_urls": null, "release_url": "https://pypi.org/project/withstopwatch/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Stopwatch as a context manager.", "version": "0.2.0" }, "last_serial": 4129382, "releases": { "0.0.10": [ { "comment_text": "", "digests": { "md5": "360a45d92d112ed8d95781d6aa8975c5", "sha256": "554e7cca1e84d220e3ca9553857769f203cb006cbb2519ad4dc7ee95bb04d5f8" }, "downloads": -1, "filename": "withstopwatch-0.0.10.tar.gz", "has_sig": false, "md5_digest": "360a45d92d112ed8d95781d6aa8975c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2038, "upload_time": "2018-04-05T13:08:46", "url": "https://files.pythonhosted.org/packages/36/40/856b6605cade3e4f8f9717cf28598f378953d6b4085c4ca00fc73462364e/withstopwatch-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "8294fba420a8c58c68ccf2bd0f81edd3", "sha256": "428089e747cbbb3e22eea45c41442427b85c3e3e975369c4a7fff9fe3d4f6378" }, "downloads": -1, "filename": "withstopwatch-0.0.11.tar.gz", "has_sig": false, "md5_digest": "8294fba420a8c58c68ccf2bd0f81edd3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2130, "upload_time": "2018-04-05T13:22:38", "url": "https://files.pythonhosted.org/packages/af/62/16a2a21aa5155d4be7c2e629e126bd32e88d73d52aef72be8bf181268a17/withstopwatch-0.0.11.tar.gz" } ], "0.0.12": [ { "comment_text": "", "digests": { "md5": "493a6576d3e4a4e88e71c86118a23272", "sha256": "744c6fb9b4dc16b942ea2df6e6edacbaa16519758b80c4533ff9d41ad98404fc" }, "downloads": -1, "filename": "withstopwatch-0.0.12.tar.gz", "has_sig": false, "md5_digest": "493a6576d3e4a4e88e71c86118a23272", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2146, "upload_time": "2018-04-05T13:25:45", "url": "https://files.pythonhosted.org/packages/53/d7/226be521dfd78aa5f3b798ad1fa6ad7dbfb34e02d11fbd22d341218e390f/withstopwatch-0.0.12.tar.gz" } ], "0.0.13": [ { "comment_text": "", "digests": { "md5": "da80acd2ccbeaa146c711908bfa7ab5b", "sha256": "ef76b0a65ab839bbbd054b707518324fcb0a9d677acb0d5b1be0a3e9fefe327b" }, "downloads": -1, "filename": "withstopwatch-0.0.13.tar.gz", "has_sig": false, "md5_digest": "da80acd2ccbeaa146c711908bfa7ab5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2185, "upload_time": "2018-04-05T13:39:36", "url": "https://files.pythonhosted.org/packages/2a/72/51ef8f643b5ece1ec3c04275927189cfc815d4f8003612a615eb84625d0f/withstopwatch-0.0.13.tar.gz" } ], "0.0.14": [ { "comment_text": "", "digests": { "md5": "e19caac2e7e21cf83484cbb231948904", "sha256": "3c262aad090404c5e0045027eef1bb9e5804c945ac1dad6c59466da911e1c460" }, "downloads": -1, "filename": "withstopwatch-0.0.14.tar.gz", "has_sig": false, "md5_digest": "e19caac2e7e21cf83484cbb231948904", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2188, "upload_time": "2018-04-05T13:47:00", "url": "https://files.pythonhosted.org/packages/4e/cc/42765390513adab95cd77f25b5b1bd0b95c2044b4ca84a89764984c20d70/withstopwatch-0.0.14.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "4f7254b0f839e73df199846fa0f653af", "sha256": "4d2ad34a4be9c9d1bde12160d240f86b542187a06eda4018958471cfb414b6af" }, "downloads": -1, "filename": "withstopwatch-0.0.9.tar.gz", "has_sig": false, "md5_digest": "4f7254b0f839e73df199846fa0f653af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2007, "upload_time": "2018-04-05T13:05:23", "url": "https://files.pythonhosted.org/packages/16/a8/ebe64524c21bbaf6e633d25edea0c4f8eb4bd459cc99630362b7b2c569e8/withstopwatch-0.0.9.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "bcee35eae469807edbd3ce320e5ff245", "sha256": "67ad77801f53c6ee8ad5d7d86e933c12d73bf23887abd178c4b1160897772399" }, "downloads": -1, "filename": "withstopwatch-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bcee35eae469807edbd3ce320e5ff245", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2212, "upload_time": "2018-04-07T05:29:32", "url": "https://files.pythonhosted.org/packages/88/9c/6faf2e533bb79327b07999ce96a2cfcf385b3ab1b34edfe26d1b2ffb7105/withstopwatch-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "9ad0148bf78394a36e7432826f86054d", "sha256": "8d076795a224705dde7245e8b0b9bec63576e66d405cc74df73ce96a5a686cb3" }, "downloads": -1, "filename": "withstopwatch-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9ad0148bf78394a36e7432826f86054d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2248, "upload_time": "2018-04-07T05:34:41", "url": "https://files.pythonhosted.org/packages/e8/e4/63711476d336d3a8113f7b3f7aaf6e3da24edba6f9ef0047c3561f4723fa/withstopwatch-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e9ff1378cd6ffb22d06f581404ba17a6", "sha256": "3ba57bbca4a2e64e0a4a4de59a6b450dd4e43a4732ffd5d2ed6c8100d0df7448" }, "downloads": -1, "filename": "withstopwatch-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e9ff1378cd6ffb22d06f581404ba17a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2249, "upload_time": "2018-04-07T05:37:01", "url": "https://files.pythonhosted.org/packages/85/a0/14e43ad6d3a7837e0026056aa999ca3e28243c2905e34c0466c4643fba60/withstopwatch-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "991fcfe77c70838afcd56a4c648f58ca", "sha256": "5ca3003cf7e6b0c5e7f492f1ac6c4ac2c1702c1829a417fa75f220da22715aa2" }, "downloads": -1, "filename": "withstopwatch-0.2.0.tar.gz", "has_sig": false, "md5_digest": "991fcfe77c70838afcd56a4c648f58ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2388, "upload_time": "2018-08-02T16:48:13", "url": "https://files.pythonhosted.org/packages/29/0a/5106a19776ada97893f4915186ca43d33c8d6397a36ab8d3b093501dd92c/withstopwatch-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "991fcfe77c70838afcd56a4c648f58ca", "sha256": "5ca3003cf7e6b0c5e7f492f1ac6c4ac2c1702c1829a417fa75f220da22715aa2" }, "downloads": -1, "filename": "withstopwatch-0.2.0.tar.gz", "has_sig": false, "md5_digest": "991fcfe77c70838afcd56a4c648f58ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2388, "upload_time": "2018-08-02T16:48:13", "url": "https://files.pythonhosted.org/packages/29/0a/5106a19776ada97893f4915186ca43d33c8d6397a36ab8d3b093501dd92c/withstopwatch-0.2.0.tar.gz" } ] }