Skip to content

Repository files navigation

Nextcloud ExApp Python Framework

Analysis & Coverage

NextcloudVersionPythonVersionimplpypi

Python framework for building Nextcloud ExApps (External Applications).

Built on top of nc_py_api, this package provides everything needed to create full-featured Nextcloud applications with their own UI, AI providers, Talk bots, and more.

Key features

  • Full ExApp lifecycle: Handles registration, authentication, heartbeat, and initialization.
  • FastAPI integration: Middleware, dependency injection, and static file mounting out of the box.
  • UI APIs: Register top menu entries, file actions, declarative settings, scripts, and styles.
  • AI Providers: TaskProcessing provider registration and task management.
  • Talk Bots: Build conversational bots for Nextcloud Talk.
  • OCC Commands: Register custom OCC commands from your ExApp.
  • Async: Fully async API built on top of niquests.

Nextcloud skeleton app

fromcontextlibimportasynccontextmanagerfromfastapiimportFastAPIfromnc_py_appimportNextcloudAppfromnc_py_app.ex_appimportAppAPIAuthMiddleware, LogLvl, run_app, set_handlers@asynccontextmanagerasyncdeflifespan(app: FastAPI):
set_handlers(app, enabled_handler)
yieldAPP=FastAPI(lifespan=lifespan)
APP.add_middleware(AppAPIAuthMiddleware)
asyncdefenabled_handler(enabled: bool, nc: NextcloudApp) ->str:
ifenabled:
awaitnc.log(LogLvl.WARNING, "Hello from nc_py_app.")
else:
awaitnc.log(LogLvl.WARNING, "Bye bye from nc_py_app.")
return""if__name__=="__main__":
run_app("main:APP", log_level="trace")

Migration from nc_py_api

If your ExApp currently imports from nc_py_api, migration is straightforward:

- from nc_py_api import NextcloudApp- from nc_py_api.ex_app import set_handlers, nc_app, run_app- from nc_py_api.talk_bot import TalkBot+ from nc_py_app import NextcloudApp+ from nc_py_app.ex_app import set_handlers, nc_app, run_app+ from nc_py_app.talk_bot import TalkBot

Common types like NextcloudException, FsNode, FilePermissions are re-exported from nc_py_app so you don't need to import from both packages.

Support

More Information

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages