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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e0a7dafbf1a08c1d04226978688e1c61f719edfd8692b1399a5ef36207a218d |
|
MD5 | 1db370c05542bf3e7d6d6d46cdd676cf |
|
BLAKE2b-256 | 28c02b07c4e9d758c165815989b07575003420f851ec40b0e019f4d16a5fb320 |
Close
Hashes for PyFoldingAtHomeControl-1.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb7e5dcf5d42efbba0ee4bd363fb92fa486d3d1b606e339a48989551011c42dc |
|
MD5 | d32e8ffa724da564205e338949428a1f |
|
BLAKE2b-256 | d6f81dd5cd99db548b4a46b8414f7675baf51fe67bfd5a15eff31acb0c8f36ed |