Skip to main content

Nextcloud Python Framework

Analysis & Coverage codecov

NextcloudVersion PythonVersion impl pypi

Python library that provides a robust and well-documented API that allows developers to interact with and extend Nextcloud's functionality.

The key features are:

  • Fast: High performance, and as low-latency as possible.
  • Intuitive: Fast to code, easy to use.
  • Reliable: Minimum number of incompatible changes.
  • Robust: All code is covered with tests as much as possible.
  • Easy: Designed to be easy to use.
  • Async-first: Full async API with sync wrappers available for most modules.

Deprecation notice: sync API

Starting with version 0.30.0, we are gradually removing sync wrappers in favour of the async API. The following modules have already lost their sync counterparts: Activity, Notes, User Status, and Weather Status.

All remaining sync methods will be phased out in future releases. If you are still using the sync Nextcloud / NextcloudApp classes, we recommend migrating to AsyncNextcloud / AsyncNextcloudApp as soon as possible.

Differences between the Nextcloud and NextcloudApp classes

The Nextcloud class functions as a standard Nextcloud client, enabling you to make API requests using a username and password.

On the other hand, the NextcloudApp class is designed for creating applications for Nextcloud.
It uses AppAPI to provide additional functionality allowing applications have their own graphical interface, fulfill requests from different users, and everything else that is necessary to implement full-fledged applications.

Both classes offer most of the same APIs, but NextcloudApp has a broader selection since applications typically require access to more APIs.

Any code written for the Nextcloud class can easily be adapted for use with the NextcloudApp class, as long as it doesn't involve calls that require user password verification.

Nextcloud skeleton app in Python

from contextlib import asynccontextmanager

from fastapi import FastAPI

from nc_py_api import AsyncNextcloudApp
from nc_py_api.ex_app import AppAPIAuthMiddleware, LogLvl, run_app, set_handlers


@asynccontextmanager
async def lifespan(app: FastAPI):
    set_handlers(app, enabled_handler)
    yield


APP = FastAPI(lifespan=lifespan)
APP.add_middleware(AppAPIAuthMiddleware)


async def enabled_handler(enabled: bool, nc: AsyncNextcloudApp) -> str:
    if enabled:
        await nc.log(LogLvl.WARNING, "Hello from nc_py_api.")
    else:
        await nc.log(LogLvl.WARNING, "Bye bye from nc_py_api.")
    return ""


if __name__ == "__main__":
    run_app("main:APP", log_level="trace")

Support

You can support us in several ways:

  • ⭐️ Star our work (it really motivates)
  • ❗️ Create an Issue or feature request (bring to us an excellent idea)
  • 💁 Resolve some Issue or create a Pull Request (contribute to this project)
  • 🙏 Write an example of its use or help improve the project.

More Information

Release files for nc-py-api 0.30.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nc-py-api 0.30.3
File Size Uploaded
nc_py_api-0.30.3.tar.gz 85.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nc-py-api 0.30.3
File Interpreter ABI Platform
nc_py_api-0.30.3-py3-none-any.whl Python 3 none any Details

Total release size: 189.2 kB

Release files / nc_py_api-0.30.3.tar.gz

Download URL nc_py_api-0.30.3.tar.gz
Size 85.0 kB
Tags Source
SHA-256 checksum
How to use checksums
add08d4967ed86280d28a2b156965cf243c032555a8e623f59084399b3b5762e
BLAKE2b-256 checksum
How to use checksums
909d378034eb55a92c7850d4cac6e7e79823a4706e49903057c6af62ed5a3c66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / nc_py_api-0.30.3-py3-none-any.whl

Download URL nc_py_api-0.30.3-py3-none-any.whl
Size 104.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26720b848c358c59616e255c7e8725d3a0d2c7c8d02a037c7460394378ad066f
BLAKE2b-256 checksum
How to use checksums
627fa56c26bb8cae192ac790c25f2f5d6af6635ba64c84713ab517bb6c585f46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.30.3 This release

2 release files

0.30.1

2 release files

0.30.0

2 release files

0.24.1

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.2

2 release files

0.20.0

2 release files

0.19.2

2 release files

0.19.0

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.13.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.11

2 release files

0.0.10

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page