Metadata-Version: 2.4
Name: PyBOINC
Version: 0.0.1
Summary: Automated RPC GUI API based communication with BOINC clients
Home-page: https://github.com/nielstron/pyboinc/
Author: nielstron
Author-email: n.muendler@web.de
License: MIT
Keywords: python boinc xml api rpc gui science computing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Object Brokering
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

# PyBOINC - a very basic python BOINC bridge
[![Build Status](https://travis-ci.com/nielstron/pyboinc.svg?branch=dev)](https://travis-ci.com/nielstron/pyboinc)
[![Coverage Status](https://coveralls.io/repos/github/nielstron/pyboinc/badge.svg?branch=dev)](https://coveralls.io/github/nielstron/pyboinc?branch=dev)

A very basic package to connect to a [BOINC](https://boinc.berkeley.edu/) client in a pythonic way using asyncio
based on the [BOINC GUI RPC Protocol](https://boinc.berkeley.edu/trac/wiki/GuiRpcProtocol).
The Interface is primarily meant for controlling a BOINC Client and hence does not support all features of the protocol.

## Usage

```python
import asyncio

from pyboinc import init_rpc_client, xml_to_dict

IP_BOINC = "127.0.0.1"
PASSWORD_BOINC = "example_password"


async def main():
    rpc_client = await init_rpc_client(IP_BOINC, PASSWORD_BOINC)
    
    # Authorize client if you will be using RPC commands which require it
    # authorize_response = await rpc_client.authorize()

    # Get status of current and older tasks
    results = await rpc_client.get_results()
    results_d = [xml_to_dict(result) for result in results]
    print(results_d)
    print(await rpc_client.get_project_status())

    # Get last three messages
    c = await rpc_client.get_message_count()
    print(c)
    print(await rpc_client.get_messages(c-3))

    print(await rpc_client.get_notices_public(2))

    # suspend task and resume
    task = (results_d[0]["project_url"], results_d[0]["name"])
    print(await rpc_client.suspend_result(*task))
    print(await rpc_client.resume_result(*task))


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
