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.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20fede9eb1084c1e18fdbfaf98f023ae984662f6bae6160afd5afb0d027237ac |
|
MD5 | 177fc20e9fad814d9a2cd8113ae415fa |
|
BLAKE2b-256 | 1ea7f4a7352e729911144dadb622756757d74a7e7dd547b71ed36ba151cdf991 |
Close
Hashes for PyFoldingAtHomeControl-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24d9a15fc402ee1468677ae1f2aed067bcb625b6d938f71eeb479cd8e1c8eda3 |
|
MD5 | 090873f3d31df6b1fc00ff8e5418b00a |
|
BLAKE2b-256 | 4912d0bc0565f0c916170ae90bc95b16a1ac00efb8b15210807ec79869617ed1 |