{ "info": { "author": "Center for Data Science and Public Policy", "author_email": "datascifellows@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 3.5" ], "description": "signalled-timeout\n=================\n\nTimeout library for generic interruption of main thread by an exception\nafter a configurable duration.\n\nUse case\n--------\n\nSet a timeout (seconds) upon expiration of which an exception is raised:\n\n::\n\n from timeout import timeout\n\n...as a context manager:\n\n::\n\n with timeout(0.5):\n ... work ...\n\n...or decorating a function:\n\n::\n\n @timeout(0.5)\n def work():\n ...\n\nThe exception may be configured, either by passing an exception\ninstance, or by specifying an overriding exception class and/or\nvalue(s):\n\n::\n\n with timeout(0.5, RuntimeError(\"Work took too long\")):\n ... work ...\n\n with timeout(0.5, RuntimeError, \"Work took too long\"):\n ... work ...\n\n with timeout(0.5, exc=RuntimeError):\n ... work ...\n\n with timeout(0.5, value=\"Work took too long\"):\n ... work ...\n\n with timeout(0.5, value=(2, \"Took too long\", 'work.py')):\n ... work ...\n\nThe timeout exception defaults to\n``TimeoutError(\"Operation timed out\")``.\n\nNote: ``timeout`` is implemented via ``signal``, and as such may not be\napplied outside of a process's main thread.\n\nInstallation\n------------\n\n``signalled-timeout`` is a Python distribution, which may be installed\nvia ``easy_install`` or ``pip``, *e.g.*:\n\n::\n\n pip install signalled-timeout\n\n...or, from source:\n\n::\n\n python setup.py install\n\nTesting\n-------\n\nTo test the distribution on your system, execute its ``test`` command:\n\n::\n\n python setup.py test\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dssg/signalled-timeout", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "signalled-timeout", "package_url": "https://pypi.org/project/signalled-timeout/", "platform": "", "project_url": "https://pypi.org/project/signalled-timeout/", "project_urls": { "Homepage": "https://github.com/dssg/signalled-timeout" }, "release_url": "https://pypi.org/project/signalled-timeout/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Timeout library for generic interruption of main thread by an exception after a configurable duration", "version": "1.0.0" }, "last_serial": 3317510, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2d7648010651900feeea6b35c62cf381", "sha256": "7fa88a7083a69e4c38b5f26e191a101a052dd39c85f5e79cbfb3ee38efb084f9" }, "downloads": -1, "filename": "signalled-timeout-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2d7648010651900feeea6b35c62cf381", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2688, "upload_time": "2017-11-08T21:46:14", "url": "https://files.pythonhosted.org/packages/98/d1/0feeeb2ea3ca26388e06e1c4637fa4915519242a1f1a7a84076e60867d65/signalled-timeout-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2d7648010651900feeea6b35c62cf381", "sha256": "7fa88a7083a69e4c38b5f26e191a101a052dd39c85f5e79cbfb3ee38efb084f9" }, "downloads": -1, "filename": "signalled-timeout-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2d7648010651900feeea6b35c62cf381", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2688, "upload_time": "2017-11-08T21:46:14", "url": "https://files.pythonhosted.org/packages/98/d1/0feeeb2ea3ca26388e06e1c4637fa4915519242a1f1a7a84076e60867d65/signalled-timeout-1.0.0.tar.gz" } ] }