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.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c990f07917d5b0ba5049fbdb5f9e2fba346aea5051617760818e1d729b048ca1 |
|
MD5 | 3d246a28b2bb77539722f26aa17729e8 |
|
BLAKE2b-256 | 5d8bcc8d6ea4f7ddae2a1f6299ba39d84066454a4269782226236d596d2aae85 |
Close
Hashes for PyFoldingAtHomeControl-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49649522073c26e54eab76cfc1d4fa945cebc2431f2d9ffa8019c172e46255bb |
|
MD5 | af33481a46931dcda82961b402740b74 |
|
BLAKE2b-256 | 6724f1b820edeacd6533b9aaac7e2a6d0a8a82334c37ff6062b200cc339493bc |