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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3333cec4cc9d8b0b89009eba4d65f6a55f261ef145a1bee50543fdffc8e4c4c |
|
MD5 | 99b20c4188bc8febd1683bcbcc50bc7b |
|
BLAKE2b-256 | 43c145b06938b6975fe122af0c4bef7758e0bfb0f312443e3226eafbccb32559 |
Close
Hashes for PyFoldingAtHomeControl-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66b59364dcde91efb99286eae132ba6cb01f88b19be8f8bde7aa96481b05bba3 |
|
MD5 | 3ea99619d9064bae1a1d992ebacbc50c |
|
BLAKE2b-256 | 65db2f1ac481e9ece06fcd04d3d2d4e7b26107312677cf0a8c7e7bb2322f6dc9 |