aaronsegura / nextcloud-async

Async-capable python wrapper for Nextcloud APIs
GNU General Public License v3.0
13 stars 5 forks source link
asyncio maps nextcloud ocs python3 spreed

nextcloud-async

Asynchronous Nextcloud Client

This module provides an asyncio-friendly interface to public NextCloud APIs.

Covered APIs

APIs To Do

If you know of any APIs missing from this list, please open an issue at https://github.com/aaronsegura/nextcloud-async/issues with a link to the API documentation so it can be added. This project aims to eventually cover any API provided by NextCloud and commonly used NextCloud apps.

Example Usage

import httpx
import asyncio
from nextcloud_async import NextCloudAsync

nca = NextCloudAsync(
    client=httpx.AsyncClient(),
    endpoint='http://localhost:8181',
    user='user',
    password='password')

async def main():
    users = await nca.get_users()
    tasks = [nca.get_user(user) for user in users]
    results = await asyncio.gather(*tasks)
    for user_info in results:
        print(user_info)

if __name__ == "__main__":
    asyncio.run(main())

This project is not endorsed or recognized in any way by the NextCloud project.