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.
- 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.
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")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 TalkBotCommon types like NextcloudException, FsNode, FilePermissions are re-exported
from nc_py_app so you don't need to import from both packages.
- Create an Issue or feature request
- Join the Discussions
- Contribute via Pull Requests