# PyFoldingAtHomeControl
Python library to get stats from your Folding@Home Clients
[![GitHub Actions](https://github.com/eifinger/PyFoldingAtHomeControl/workflows/Python%20package/badge.svg)](https://github.com/eifinger/PyFoldingAtHomeControl/actions?workflow=Python+package)
[![PyPi](https://img.shields.io/pypi/v/PyFoldingAtHomeControl.svg)](https://pypi.python.org/pypi/PyFoldingAtHomeControl)
[![PyPi](https://img.shields.io/pypi/l/PyFoldingAtHomeControl.svg)](https://github.com/eifinger/PyFoldingAtHomeControl/blob/master/LICENSE)
[![codecov](https://codecov.io/gh/eifinger/PyFoldingAtHomeControl/branch/master/graph/badge.svg)](https://codecov.io/gh/eifinger/PyFoldingAtHomeControl)
[![Downloads](https://pepy.tech/badge/pyfoldingathomecontrol)](https://pepy.tech/project/pyfoldingathomecontrol)
## Installation
```bash
pip install PyFoldingAtHomeControl
```
## Usage
```python
import asyncio
from FoldingAtHomeControl import FoldingAtHomeController
from FoldingAtHomeControl import PyOnMessageTypes
def callback(message_type, data):
print(f"callback for: {message_type}: ", data)
async def cancel_task(task_to_cancel):
task_to_cancel.cancel()
await task_to_cancel
if __name__ == "__main__":
Controller = FoldingAtHomeController("localhost")
Controller.register_callback(callback)
loop = asyncio.get_event_loop()
task = loop.create_task(Controller.start())
try:
loop.run_until_complete(task)
except KeyboardInterrupt:
pass
finally:
print("Cancelling task")
try:
loop.run_until_complete(cancel_task(task))
except asyncio.CancelledError:
print("Closing Loop")
loop.close()
```
Raw data
{
"_id": null,
"home_page": "http://github.com/eifinger/PyFoldingAtHomeControl",
"name": "pyfoldingathomecontrol",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "Folding@Home,asyncio",
"author": "Kevin Stillhammer",
"author_email": "kevin.stillhammer@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/90/c6/aa1f450b320adbe5000102862648cb09530f4c4d02d284faee7f2e4495e9/pyfoldingathomecontrol-3.0.1.tar.gz",
"platform": null,
"description": "# PyFoldingAtHomeControl\n\nPython library to get stats from your Folding@Home Clients\n\n[![GitHub Actions](https://github.com/eifinger/PyFoldingAtHomeControl/workflows/Python%20package/badge.svg)](https://github.com/eifinger/PyFoldingAtHomeControl/actions?workflow=Python+package)\n[![PyPi](https://img.shields.io/pypi/v/PyFoldingAtHomeControl.svg)](https://pypi.python.org/pypi/PyFoldingAtHomeControl)\n[![PyPi](https://img.shields.io/pypi/l/PyFoldingAtHomeControl.svg)](https://github.com/eifinger/PyFoldingAtHomeControl/blob/master/LICENSE)\n[![codecov](https://codecov.io/gh/eifinger/PyFoldingAtHomeControl/branch/master/graph/badge.svg)](https://codecov.io/gh/eifinger/PyFoldingAtHomeControl)\n[![Downloads](https://pepy.tech/badge/pyfoldingathomecontrol)](https://pepy.tech/project/pyfoldingathomecontrol)\n\n## Installation\n\n```bash\npip install PyFoldingAtHomeControl\n```\n\n## Usage\n\n```python\nimport asyncio\nfrom FoldingAtHomeControl import FoldingAtHomeController\nfrom FoldingAtHomeControl import PyOnMessageTypes\n\n\ndef callback(message_type, data):\n print(f\"callback for: {message_type}: \", data)\n\n\nasync def cancel_task(task_to_cancel):\n task_to_cancel.cancel()\n await task_to_cancel\n\n\nif __name__ == \"__main__\":\n Controller = FoldingAtHomeController(\"localhost\")\n Controller.register_callback(callback)\n loop = asyncio.get_event_loop()\n task = loop.create_task(Controller.start())\n try:\n loop.run_until_complete(task)\n except KeyboardInterrupt:\n pass\n finally:\n print(\"Cancelling task\")\n try:\n loop.run_until_complete(cancel_task(task))\n except asyncio.CancelledError:\n print(\"Closing Loop\")\n loop.close()\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python library to get stats from your Folding@Home Clients",
"version": "3.0.1",
"split_keywords": [
"folding@home",
"asyncio"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "741f10ecb1b4cc38276afca186f5f0301ba35d3112dd9f03576fe20a86daf61d",
"md5": "d507011c1e0fa9ed791351ae41ea3496",
"sha256": "9a8647fd22086ca5ae73dfc4161db270e54c4e7e8d65a5197b2f3c0efca09bc7"
},
"downloads": -1,
"filename": "pyfoldingathomecontrol-3.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d507011c1e0fa9ed791351ae41ea3496",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 9206,
"upload_time": "2023-03-10T20:50:48",
"upload_time_iso_8601": "2023-03-10T20:50:48.405315Z",
"url": "https://files.pythonhosted.org/packages/74/1f/10ecb1b4cc38276afca186f5f0301ba35d3112dd9f03576fe20a86daf61d/pyfoldingathomecontrol-3.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "90c6aa1f450b320adbe5000102862648cb09530f4c4d02d284faee7f2e4495e9",
"md5": "b38e5a864136c878e1b6a9c406e2afdb",
"sha256": "d485fa4a6fa3696ad72f9918d9bed87071cf006f6f803ee4c365ac1dd6d50ddf"
},
"downloads": -1,
"filename": "pyfoldingathomecontrol-3.0.1.tar.gz",
"has_sig": false,
"md5_digest": "b38e5a864136c878e1b6a9c406e2afdb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 7261,
"upload_time": "2023-03-10T20:50:50",
"upload_time_iso_8601": "2023-03-10T20:50:50.039011Z",
"url": "https://files.pythonhosted.org/packages/90/c6/aa1f450b320adbe5000102862648cb09530f4c4d02d284faee7f2e4495e9/pyfoldingathomecontrol-3.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-10 20:50:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "eifinger",
"github_project": "PyFoldingAtHomeControl",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyfoldingathomecontrol"
}