JeffResc / Unmanic-API

Asynchronous Python client for Unmanic

Home Page:https://jeffresc.dev/Unmanic-API/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

codecov PyPI PyPI - Downloads GitHub

Unmanic-API

Asynchronous Python client for Unmanic.

Please note that not all features of the v2 API have been implemented, rather a few key endpoints that most users should find useful for automation.

Installing

pip install unmanic-api

Quick-Start Example

"""
Pause resume example.

Connect to Unmanic instance, pause worker "W0", wait 5 seconds and resume worker "W0".
"""
import asyncio

from unmanic_api import Unmanic

async def main():
    async with Unmanic('localhost') as unmanic:
        print(await unmanic.pause_worker("W0"))
        await asyncio.sleep(5)
        print(await unmanic.resume_worker("W0"))

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

See Also

About

Asynchronous Python client for Unmanic

https://jeffresc.dev/Unmanic-API/

License:GNU General Public License v3.0


Languages

Language:Python 100.0%