{% extends "main.html" %} {% block content %}
Plugin framework SDK for xcore — batteries included.
One import. Every capability.
from xcore.sdk import AutoMixin, action, on_event from xcore.sdk import ok, traced, cached class Plugin(AutoMixin): @action("get_user") @traced("get_user") @cached(ttl=300, key=lambda self, p: f"user:{p['id']}") async def get_user(self, payload: dict) -> dict: db = self.get_service("db") async with db.session() as s: user = await s.get(User, payload["id"]) return ok(user=user) @on_event("user.created") async def welcome(self, event): self.logger.info("welcome %s", event.data["email"])
From HTTP routes to scheduled tasks — every capability is one decorator away.
All mixins composed into a single base class. No boilerplate, no MRO headaches — just inherit and build.
EventMixin · HookMixin · ScheduledMixin · ...Async event bus with wildcard patterns and priority ordering. Hook into kernel lifecycle events with zero wiring.
on_event("user.*") · on_hook("plugin.*.loaded")Distributed tracing, metrics counters and histograms, health checks — all declarative, all zero-config.
self.logger · self.ctx.metrics · self.ctx.tracer
APScheduler-backed cron expressions and fixed intervals.
Jobs register in on_load, clean up in on_unload.
Transparent result caching with custom key strategies. Memory or Redis backend — same API, swapped in config.
@cached(ttl=300, key=lambda self, p: f"u:{p['id']}")Ready-to-subclass base repositories for SQL (async/sync), MongoDB (Motor) and Redis — with serialization included.
BaseAsyncRepository · BaseMongoRepository · BaseRedisRepositoryInstall, inherit, ship.
# 1. install uv add xcore # 2. create plugin.yaml echo "name: my_plugin version: 1.0.0 execution_mode: trusted" > plugin.yaml # 3. add a Plugin class and run xcore plugin run my_plugin