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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nc_py_api-0.30.3.tar.gz (85.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nc_py_api-0.30.3-py3-none-any.whl (104.2 kB view details)

Uploaded Python 3

File details

Details for the file nc_py_api-0.30.3.tar.gz.

File metadata

  • Download URL: nc_py_api-0.30.3.tar.gz
  • Upload date:
  • Size: 85.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for nc_py_api-0.30.3.tar.gz
Algorithm Hash digest
SHA256 add08d4967ed86280d28a2b156965cf243c032555a8e623f59084399b3b5762e
MD5 e569e5aee0eb0bc98c2cd475f38cf895
BLAKE2b-256 909d378034eb55a92c7850d4cac6e7e79823a4706e49903057c6af62ed5a3c66

See more details on using hashes here.

File details

Details for the file nc_py_api-0.30.3-py3-none-any.whl.

File metadata

  • Download URL: nc_py_api-0.30.3-py3-none-any.whl
  • Upload date:
  • Size: 104.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for nc_py_api-0.30.3-py3-none-any.whl
Algorithm Hash digest
SHA256 26720b848c358c59616e255c7e8725d3a0d2c7c8d02a037c7460394378ad066f
MD5 4050d32415a1b2d12171b164381e96d1
BLAKE2b-256 627fa56c26bb8cae192ac790c25f2f5d6af6635ba64c84713ab517bb6c585f46

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.30.3 This release

2 files

0.30.2

2 files

0.30.1

2 files

0.30.0

2 files

0.24.2

2 files

0.24.1

2 files

0.24.0

2 files

0.23.1

2 files

0.23.0

2 files

0.22.0

2 files

0.21.1

2 files

0.21.0

2 files

0.20.2

2 files

0.20.1

2 files

0.20.0

2 files

0.19.2

2 files

0.19.1

2 files

0.19.0

2 files

0.18.2

2 files

0.18.1

2 files

0.18.0

2 files

0.17.1

2 files

0.17.0

2 files

0.16.0

2 files

0.15.1

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.1

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

0.0.43

2 files

0.0.42

2 files

0.0.41

2 files

0.0.40

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.11

2 files

0.0.10

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page