Skip to main content

Python lib to get stats from your Folding@Home clients.

Project description

PyFoldingAtHomeControl - BETA

Python library to get stats from your Folding@Home Clients

GitHub Actions PyPi PyPi codecov Downloads

Installation

$ pip install PyFoldingAtHomeControl

Usage

import asyncio
from FoldingAtHomeControl import FoldingAtHomeController
from FoldingAtHomeControl import PyOnMessageTypes


def logger_callback(data):
    print("callback:", data)


async def cancel_task(task_to_cancel):
    task_to_cancel.cancel()
    await task_to_cancel


if __name__ == '__main__':
    Controller = FoldingAtHomeController("localhost")
    for message_type in PyOnMessageTypes:
        Controller.register_callback_for_message_type(message_type.value, logger_callback)
    loop = asyncio.get_event_loop()
    task = loop.create_task(Controller.run())
    try:
        loop.run_forever()
    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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyFoldingAtHomeControl-0.0.2.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

PyFoldingAtHomeControl-0.0.2-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page