/Unmanic-API

Asynchronous Python client for Unmanic

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

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