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 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


Download files

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

Source Distribution

PyFoldingAtHomeControl-1.1.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyFoldingAtHomeControl-1.1.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file PyFoldingAtHomeControl-1.1.2.tar.gz.

File metadata

  • Download URL: PyFoldingAtHomeControl-1.1.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for PyFoldingAtHomeControl-1.1.2.tar.gz
Algorithm Hash digest
SHA256 c990f07917d5b0ba5049fbdb5f9e2fba346aea5051617760818e1d729b048ca1
MD5 3d246a28b2bb77539722f26aa17729e8
BLAKE2b-256 5d8bcc8d6ea4f7ddae2a1f6299ba39d84066454a4269782226236d596d2aae85

See more details on using hashes here.

File details

Details for the file PyFoldingAtHomeControl-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: PyFoldingAtHomeControl-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for PyFoldingAtHomeControl-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49649522073c26e54eab76cfc1d4fa945cebc2431f2d9ffa8019c172e46255bb
MD5 af33481a46931dcda82961b402740b74
BLAKE2b-256 6724f1b820edeacd6533b9aaac7e2a6d0a8a82334c37ff6062b200cc339493bc

See more details on using hashes here.

Supported by

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