Python lib to get stats from your Folding@Home clients.
Project description
PyFoldingAtHomeControl - BETA
Python library to get stats from your Folding@Home Clients
Installation
$ pip install PyFoldingAtHomeControl
Usage
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()
loop.run_until_complete(Controller.try_connect_async(5))
loop.run_until_complete(Controller.subscribe_async())
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for PyFoldingAtHomeControl-1.2.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd635fb9ec30c33fe38aa62cc66bff4f3057ab538e20543453f01acaf424617 |
|
MD5 | e8fc7a5dade2c608a9c13f9abf0051bb |
|
BLAKE2b-256 | a9d95ee67b0caf877a402ca6c05fc31bc8ae0f5aec5136d7a4956f4c2f0e1188 |
Close
Hashes for PyFoldingAtHomeControl-1.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53259ff0e5fc6e5bf5f21931938b5de7b97df18f05c02768eb424d33aeb64c61 |
|
MD5 | 724610c8cd913c6f69f3e557a1562c07 |
|
BLAKE2b-256 | 91ca3774a7588ee68ffb0fcb341ae2ffb61f106d4ffcee95ed67eb34ed08e383 |