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.2.5.tar.gz (6.3 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.2.5-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: PyFoldingAtHomeControl-1.2.5.tar.gz
  • Upload date:
  • Size: 6.3 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.2.5.tar.gz
Algorithm Hash digest
SHA256 acd635fb9ec30c33fe38aa62cc66bff4f3057ab538e20543453f01acaf424617
MD5 e8fc7a5dade2c608a9c13f9abf0051bb
BLAKE2b-256 a9d95ee67b0caf877a402ca6c05fc31bc8ae0f5aec5136d7a4956f4c2f0e1188

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyFoldingAtHomeControl-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 9.2 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.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 53259ff0e5fc6e5bf5f21931938b5de7b97df18f05c02768eb424d33aeb64c61
MD5 724610c8cd913c6f69f3e557a1562c07
BLAKE2b-256 91ca3774a7588ee68ffb0fcb341ae2ffb61f106d4ffcee95ed67eb34ed08e383

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