Nextcloud Python Framework
Project description
Nextcloud Python Framework
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 with excellent documentation.
- Sync + Async: Provides both sync and async APIs.
Capabilities
Capability | Nextcloud 26 | Nextcloud 27 | Nextcloud 28 |
---|---|---|---|
Calendar | ✅ | ✅ | ✅ |
File System & Tags | ✅ | ✅ | ✅ |
Nextcloud Talk | ✅ | ✅ | ✅ |
Notifications | ✅ | ✅ | ✅ |
Shares | ✅ | ✅ | ✅ |
Users & Groups | ✅ | ✅ | ✅ |
User & Weather status | ✅ | ✅ | ✅ |
Other APIs*** | ✅ | ✅ | ✅ |
Talk Bot API* | N/A | ✅ | ✅ |
Text Processing* | N/A | ❌ | ❌ |
SpeechToText* | N/A | ❌ | ❌ |
*available only for NextcloudApp
***Activity, Notes
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.
NextcloudApp avalaible only from Nextcloud 27.1.2 and greater version with installed AppAPI.
Nextcloud skeleton app in Python
from contextlib import asynccontextmanager
from fastapi import FastAPI
from nc_py_api import NextcloudApp
from nc_py_api.ex_app import LogLvl, run_app, set_handlers
@asynccontextmanager
async def lifespan(_app: FastAPI):
set_handlers(APP, enabled_handler)
yield
APP = FastAPI(lifespan=lifespan)
def enabled_handler(enabled: bool, nc: NextcloudApp) -> str:
if enabled:
nc.log(LogLvl.WARNING, "Hello from nc_py_api.")
else:
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 correct a typo in the documentation.
More Information
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nc_py_api-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0f835b9e2b444c3bfe29a4b06c8a1ad708e330073ee097b0bf94da66f882139 |
|
MD5 | b164a28142733e8ef9d6fd51c64381be |
|
BLAKE2b-256 | 7deba0b327be140e52136f04a1c099cf34cb36b0fb3a4cfc216e0496a0f59c95 |