{ "info": { "author": "Lucas Langholf", "author_email": "lucas@elpunkt.eu", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5" ], "description": "# mp_throttle\n#### A Python package to monitor and throttle multiprocessing processes.\n\n## Use case:\nThis package can be used to control and monitor Pythons [multiprocessing](https://docs.python.org/3.4/library/multiprocessing.html?highlight=process) processes or [threading](https://docs.python.org/3.4/library/threading.html) threads. The central Throttle class can be used to monitor the current and the mean frequency of processes/threads and/or to throttle them to execute a limited times per second. This can be used to limit the server requests of a multi-process web crawler.\n\n## Example:\n```python\n import multiprocessing\n import mp_throttle\n import time\n\n def work(tank):\n while not tank.kill_flag.is_set():\n # Block until 'fuel' is available.\n tank.await_fuel()\n # do something\n return\n\n # Limit the processes to 4 per 1 second, by providing 4 'fuel' per second.\n throttle = mp_throttle.Throttle(4,1)\n workerpool = multiprocessing.Pool(processes=4, initializer=work, initargs=(throttle,))\n throttle.start()\n time.sleep(5)\n # Stops the processes and return stats:\n runtime, total_processes, mean_frequency, mean_processes_per_second = throttle.stop()\n print(\"Runtime: {}\".format(runtime))\n print(\"Total: {}\".format(total_processes))\n print(\"Mean frequency: {}\".format(mean_frequency))\n print(\"Processes per second: {}\".format(mean_processes_per_second))\n```\nOutput:\n\n >>> Runtime: 5.027516841888428\n >>> Total: 20\n >>> Mean frequency: 0.25046865940093993\n >>> Processes per second: 3.9925154803469485\n\n\n## Installation:\n\nTo install mp_throttle, simply use pip:\n\n pip install mp_throttle\n\n\n## Documentation:\nFor the full documentation see [docs.elpunkt.eu](http://docs.elpunkt.eu/mp_throttle)\n\n## How to Contribute:\n1. Test mp_throttle and open an issue to report a bug or discuss a feature idea.\n2. Give general feedback on the code and the package structure. Since this is my first python package, I'm sure there is a lot to feedback on:)\n3. Fork the repository and make your changes.\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/elpunkt/mp_throttle", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mp-throttle", "package_url": "https://pypi.org/project/mp-throttle/", "platform": "", "project_url": "https://pypi.org/project/mp-throttle/", "project_urls": { "Homepage": "https://github.com/elpunkt/mp_throttle" }, "release_url": "https://pypi.org/project/mp-throttle/0.0.5/", "requires_dist": null, "requires_python": "", "summary": "Package to monitor and throttle multiple processes or threads.", "version": "0.0.5" }, "last_serial": 4252013, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "824e99b1731d994c3dc9792d913d5b4e", "sha256": "7ae5adca71c589200e3693e146bdb2f1ee46e07e8cad7aa0d17d2a0903e5d79b" }, "downloads": -1, "filename": "mp_throttle-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "824e99b1731d994c3dc9792d913d5b4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5100, "upload_time": "2018-08-15T21:39:58", "url": "https://files.pythonhosted.org/packages/b2/4e/37d6586aa8b3e7282cca4c5ba03e4b30825c439e0b73eddf81247fd09a5b/mp_throttle-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3ee4f99f613f031b75dbb4c952cb0f96", "sha256": "406bcb366bfc721c59e74aecea87317c1bfa06f22936d4d877321eb547999c03" }, "downloads": -1, "filename": "mp_throttle-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3ee4f99f613f031b75dbb4c952cb0f96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4766, "upload_time": "2018-08-15T21:40:00", "url": "https://files.pythonhosted.org/packages/a2/a6/c020e7d01aa9ac07be45b59d15c430a5ac4c8549c1fbf4289703c6a53b25/mp_throttle-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "c7a709cb1f102191a1d58d5bf31a7146", "sha256": "633faf1581fd18ff1b718cc15dae7250691d6dc0744b592fb32adc02a47016af" }, "downloads": -1, "filename": "mp_throttle-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "c7a709cb1f102191a1d58d5bf31a7146", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5155, "upload_time": "2018-08-15T22:03:45", "url": "https://files.pythonhosted.org/packages/a0/a2/ba73f2e1e332d7dec6ecd5521b4d6701c85645e413318389811b16dfb649/mp_throttle-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "083f345a081c571baa8b705a8ac6c3a8", "sha256": "86c4650d117c169062dea8552276429481cd1d16ac039951238d38bcd92a5793" }, "downloads": -1, "filename": "mp_throttle-0.0.3.tar.gz", "has_sig": false, "md5_digest": "083f345a081c571baa8b705a8ac6c3a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4874, "upload_time": "2018-08-15T22:03:47", "url": "https://files.pythonhosted.org/packages/23/cb/da7aefc5dcd10fde59f7e0160aba0432cdfe3bff553bfb9076b92e6ecdb9/mp_throttle-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "64b78863355a2b0b5a0e7f9a13ade567", "sha256": "802663863faf68829976fc6d797e1086f5fb24c2eb55c2ea52db8965b9a5f0e5" }, "downloads": -1, "filename": "mp_throttle-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "64b78863355a2b0b5a0e7f9a13ade567", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5207, "upload_time": "2018-08-16T15:53:00", "url": "https://files.pythonhosted.org/packages/81/17/c5357cdbfd0e28b65df582e501a4692acf3318a8fffbf23c26640b396ccd/mp_throttle-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2c9f67dac7177bb0e7bc616e3506427", "sha256": "b8a91691f11cb8ea039f9613b3b1c766bea767c51ab5a8b61c4f52d81545644b" }, "downloads": -1, "filename": "mp_throttle-0.0.4.tar.gz", "has_sig": false, "md5_digest": "c2c9f67dac7177bb0e7bc616e3506427", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4935, "upload_time": "2018-08-16T15:53:03", "url": "https://files.pythonhosted.org/packages/9f/e8/44ccdf3bfeed8a1173474b6d9db73a01c7219769e1f4e2b62f5f05dc91d4/mp_throttle-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "de4f98208b03eb93d85a4877fb021274", "sha256": "9cc8946dd73759b318cd39b44ed68b290379ae45a023fe5dfbce774fe16e0e87" }, "downloads": -1, "filename": "mp_throttle-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "de4f98208b03eb93d85a4877fb021274", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5216, "upload_time": "2018-09-08T18:17:26", "url": "https://files.pythonhosted.org/packages/79/55/9e98d9e1c6122bbf9126d01747f20ffa53d378d17b1ba2e36c97469ee9f3/mp_throttle-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da13670d68b06caf1aafce8b27e36add", "sha256": "9a2ee2de19476d85c52bcfdcb2f8b3e546b69bdfcb7d9262421326b7244c897b" }, "downloads": -1, "filename": "mp_throttle-0.0.5.tar.gz", "has_sig": false, "md5_digest": "da13670d68b06caf1aafce8b27e36add", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4958, "upload_time": "2018-09-08T18:17:30", "url": "https://files.pythonhosted.org/packages/24/b1/fe3c125aca3b2bcc9958bbfac7708dcead03de41a936b98f12f44a051d49/mp_throttle-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de4f98208b03eb93d85a4877fb021274", "sha256": "9cc8946dd73759b318cd39b44ed68b290379ae45a023fe5dfbce774fe16e0e87" }, "downloads": -1, "filename": "mp_throttle-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "de4f98208b03eb93d85a4877fb021274", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5216, "upload_time": "2018-09-08T18:17:26", "url": "https://files.pythonhosted.org/packages/79/55/9e98d9e1c6122bbf9126d01747f20ffa53d378d17b1ba2e36c97469ee9f3/mp_throttle-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da13670d68b06caf1aafce8b27e36add", "sha256": "9a2ee2de19476d85c52bcfdcb2f8b3e546b69bdfcb7d9262421326b7244c897b" }, "downloads": -1, "filename": "mp_throttle-0.0.5.tar.gz", "has_sig": false, "md5_digest": "da13670d68b06caf1aafce8b27e36add", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4958, "upload_time": "2018-09-08T18:17:30", "url": "https://files.pythonhosted.org/packages/24/b1/fe3c125aca3b2bcc9958bbfac7708dcead03de41a936b98f12f44a051d49/mp_throttle-0.0.5.tar.gz" } ] }