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

Metadata

Release files for nc-py-api 0.31.0

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.31.0
File Size Uploaded Provenance Actions
nc_py_api-0.31.0.tar.gz 86.3 kB Without provenance Details for nc_py_api-0.31.0.tar.gz

Built distribution (wheel)

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

Total release size: 191.4 kB

Release files / nc_py_api-0.31.0.tar.gz

Download URL nc_py_api-0.31.0.tar.gz
Size 86.3 kB
Tags Source
SHA-256 checksum
How to use checksums
59c3d9975817298d7451898c5900b239ca69e5fd722dd12ada1da04d587c9af5
BLAKE2b-256 checksum
How to use checksums
3a6f711aeef3dd3196791fedc456a11064f46997fd50a3e8f69b813475b52f63
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.31.0-py3-none-any.whl

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

Security for nc-py-api 0.31.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.31.0 This release

2 release files No provenance

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