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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11940c9240d706a7da863eb83739143a34dc3da2883f343ca0777b612fd1e02e |
|
MD5 | 3c94bdb19504b5c904c8aa926d503a70 |
|
BLAKE2b-256 | dfc225d7d959973b7dafab53939d924f3964ade65c2a3826ca1a7c1918265995 |
Close
Hashes for PyFoldingAtHomeControl-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d151da4e4b84c97a036a9c0a168408dd511e9af936acddc638ed9f9be445a13 |
|
MD5 | 3a4e868c5c38eda9dc3b93865b29348c |
|
BLAKE2b-256 | 91a4baa8dd2dd8cd235a4d9243d9ba76197a981aa14ab45cb5d39861269a0e62 |