{ "info": { "author": "Vasek Dohnal", "author_email": "vaclav.dohnal@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "=======================================================\nBlock Timer: Measure execution time of your code blocks\n=======================================================\n\n.. image:: https://img.shields.io/pypi/v/block-timer.svg\n :target: https://pypi.python.org/pypi/block-timer\n :alt: PyPi\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n :target: https://pypi.python.org/pypi/block-timer/\n :alt: MIT\n\n.. image:: https://img.shields.io/travis/illagrenan/block-timer.svg\n :target: https://travis-ci.org/illagrenan/block-timer\n :alt: TravisCI\n\n.. image:: https://img.shields.io/coveralls/illagrenan/block-timer.svg\n :target: https://coveralls.io/github/illagrenan/block-timer?branch=master\n :alt: Coverage\n\n.. image:: https://pyup.io/repos/github/illagrenan/block-timer/shield.svg\n :target: https://pyup.io/repos/github/illagrenan/block-timer/\n :alt: Updates\n\n.. image:: https://img.shields.io/pypi/implementation/block-timer.svg\n\t:target: https://pypi.python.org/pypi/block-timer/\n\t:alt: Supported Python implementations\n\n.. image:: https://img.shields.io/pypi/pyversions/block-timer.svg\n\t:target: https://pypi.python.org/pypi/block-timer/\n\t:alt: Supported Python versions\n\nInstallation\n------------\n\n- Supported Python versions are: ``3.4``, ``3.5``, ``3.6`` and ``3.7``.\n\n.. code:: shell\n\n pip install --upgrade block-timer\n\nUsage\n-----\n\nYou can easily measure blocks of code using ``Timer`` class as context manager or as method/function decorator with Block Timer:\n\nElapsed time will be printed using standard ``print`` function:\n\n.. code:: python\n\n from block_timer.timer import Timer\n\n with Timer():\n pass # Some operation\n\n # Total time ... seconds will be printed\n\nIf you have multiple blocks of code, you can set ``title`` attribute:\n\n.. code:: python\n\n from block_timer.timer import Timer\n\n with Timer(title=\"Block A\"):\n pass # Some operation\n\n # [Block A] Total time ... seconds will be printed\n\n with Timer(title=\"Block B\"):\n pass # Some operation\n\n # [Block B] Total time ... seconds will be printed\n\nElapsed time (in fractional seconds) can be accessed by ``elapsed`` property. You can also disable printing by ``print_title=False``:\n\n.. code:: python\n\n from block_timer.timer import Timer\n\n with Timer(print_title=False) as t:\n pass # Some operation\n\n print(\"Elapsed time: {:f} seconds\".format(t.elapsed))\n\n\nYou can redirect output for print function:\n\n.. code:: python\n\n import sys\n\n from block_timer.timer import Timer\n\n with Timer(print_file=sys.stdout):\n pass # Some operation\n\n``Timer`` class can be used as a method/function decorator:\n\n.. code:: python\n\n @Timer(title=\"Foo\")\n def some_func():\n time.sleep(1)\n\n some_func()\n # [Foo] Total time ... seconds will be printed\n\nResources\n---------\n\n- `time.perf_counter() on Python Doc `_\n\n\nLicense\n-------\n\nThe MIT License (MIT)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/illagrenan/block-timer", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "block-timer", "package_url": "https://pypi.org/project/block-timer/", "platform": "", "project_url": "https://pypi.org/project/block-timer/", "project_urls": { "Homepage": "https://github.com/illagrenan/block-timer" }, "release_url": "https://pypi.org/project/block-timer/0.2.0/", "requires_dist": [ "typing; python_version<'3.5'" ], "requires_python": "~=3.4", "summary": "Measure execution time of your code blocks", "version": "0.2.0" }, "last_serial": 4260833, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b0186283f43a016d58b8922c2b38ff38", "sha256": "b890fdd3da4d77339acdefe8a5bc6d8e18e4e6806f25495d4c9fef496f581a15" }, "downloads": -1, "filename": "block_timer-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b0186283f43a016d58b8922c2b38ff38", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 5693, "upload_time": "2016-12-02T00:00:34", "url": "https://files.pythonhosted.org/packages/60/20/d79ae988513b47f09b253c6c32f750d4d5c796103922e60968cb7b8742dd/block_timer-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c897cca9163dc34bf8b2a3659cb713f4", "sha256": "832f23f5fe4114d75469ea4efe382fb9fd2a54557fce6f773b6e02bef1626894" }, "downloads": -1, "filename": "block-timer-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c897cca9163dc34bf8b2a3659cb713f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3584, "upload_time": "2016-12-02T00:00:29", "url": "https://files.pythonhosted.org/packages/72/9f/55c0c6279307ed8fcd0ca5e725888048f899aa91821124f63c417f038d60/block-timer-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "029e55f4656c7a0252de65d3dad65d36", "sha256": "fc5ab41b20db4727dab0c36f75cc273cee71625dcb66e1a1799f257dee4cf814" }, "downloads": -1, "filename": "block_timer-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "029e55f4656c7a0252de65d3dad65d36", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6200, "upload_time": "2016-12-03T12:33:11", "url": "https://files.pythonhosted.org/packages/0e/e2/4de2aca7e1e7a04d0567e208f7fb0f14aa9be96c0597c7881fcdab9991ac/block_timer-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36a1a563425463980e9f446eae2b935b", "sha256": "f8da30bb4e8204fab359162426b73eea8b4dbdab5beba7d58245dc9a0bea96a5" }, "downloads": -1, "filename": "block-timer-0.1.1.tar.gz", "has_sig": false, "md5_digest": "36a1a563425463980e9f446eae2b935b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3957, "upload_time": "2016-12-03T12:33:06", "url": "https://files.pythonhosted.org/packages/29/9c/f0467d378bdb39826b8b3505f8e362251d97308b6aa2b563c5412155b2a5/block-timer-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c63bbc907fabd0fc93aa715c92f90b8e", "sha256": "9ece3a04daf924bbd30c5ad7cb0cad3528dc0aa29fcc3e75d4e1dd6fa6b88596" }, "downloads": -1, "filename": "block_timer-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c63bbc907fabd0fc93aa715c92f90b8e", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6209, "upload_time": "2016-12-04T16:55:24", "url": "https://files.pythonhosted.org/packages/06/3a/794b934c7cf6b74c180adcd653ba23b3c127364c677070c729af87afed42/block_timer-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dca988b81943a7fa64ea4359461d7e21", "sha256": "c7f1bc4f3719b14c9ef5f5c6c8a34da13a81f0ec4078160aefdc1f61657877b7" }, "downloads": -1, "filename": "block-timer-0.1.2.tar.gz", "has_sig": false, "md5_digest": "dca988b81943a7fa64ea4359461d7e21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3973, "upload_time": "2016-12-04T16:55:20", "url": "https://files.pythonhosted.org/packages/0c/48/75dc8f661314736bd699bfa89b12b565ca25a60247b65ca619b148a99b83/block-timer-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "9a13e269789c3e8b8f1bbaed4846a211", "sha256": "c184e6771800781e010598b76450590f6deb018891d3bb0802ba56bd9664fa68" }, "downloads": -1, "filename": "block_timer-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9a13e269789c3e8b8f1bbaed4846a211", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": "~=3.4", "size": 3570, "upload_time": "2018-09-11T11:06:01", "url": "https://files.pythonhosted.org/packages/45/3a/b2e293fbf3ff83f84d7ba7da952a2ccb940de63d74610d812fdbe436aeab/block_timer-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c7f34fabd170c608ef2e1d8ab932741", "sha256": "fbe44155c199db67e6f5081202cf82a505704d072cbe13f7ff4151270828a892" }, "downloads": -1, "filename": "block-timer-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6c7f34fabd170c608ef2e1d8ab932741", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 4146, "upload_time": "2018-09-11T11:06:03", "url": "https://files.pythonhosted.org/packages/84/0f/88998edf792cbcfe77616f338d9b4924571aaf06adca15e4224b429a0f00/block-timer-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9a13e269789c3e8b8f1bbaed4846a211", "sha256": "c184e6771800781e010598b76450590f6deb018891d3bb0802ba56bd9664fa68" }, "downloads": -1, "filename": "block_timer-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9a13e269789c3e8b8f1bbaed4846a211", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": "~=3.4", "size": 3570, "upload_time": "2018-09-11T11:06:01", "url": "https://files.pythonhosted.org/packages/45/3a/b2e293fbf3ff83f84d7ba7da952a2ccb940de63d74610d812fdbe436aeab/block_timer-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c7f34fabd170c608ef2e1d8ab932741", "sha256": "fbe44155c199db67e6f5081202cf82a505704d072cbe13f7ff4151270828a892" }, "downloads": -1, "filename": "block-timer-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6c7f34fabd170c608ef2e1d8ab932741", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 4146, "upload_time": "2018-09-11T11:06:03", "url": "https://files.pythonhosted.org/packages/84/0f/88998edf792cbcfe77616f338d9b4924571aaf06adca15e4224b429a0f00/block-timer-0.2.0.tar.gz" } ] }