{% extends "main.html" %} {% block content %}
v1.0.0 · Python 3.12+ · MIT

xcoreSDK

Plugin framework SDK for xcore — batteries included.
One import. Every capability.

plugins/my_plugin/src/main.py
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"])
49 public exports
·
6 composable mixins
·
Python 3.12+
·
FastAPI native routes
·
MIT license
Everything you need

A complete plugin toolkit

From HTTP routes to scheduled tasks — every capability is one decorator away.

class Plugin(AutoMixin)

AutoMixin

All mixins composed into a single base class. No boilerplate, no MRO headaches — just inherit and build.

EventMixin · HookMixin · ScheduledMixin · ...
@on_event · @on_hook

Events & Hooks

Async event bus with wildcard patterns and priority ordering. Hook into kernel lifecycle events with zero wiring.

on_event("user.*") · on_hook("plugin.*.loaded")
@traced · @counted · @timed

Observability

Distributed tracing, metrics counters and histograms, health checks — all declarative, all zero-config.

self.logger · self.ctx.metrics · self.ctx.tracer
@cron · @interval

Scheduler

APScheduler-backed cron expressions and fixed intervals. Jobs register in on_load, clean up in on_unload.

@cron("0 9 * * MON-FRI") · @interval(seconds=30)
@cached · @invalidate

Cache

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']}")
SQL · MongoDB · Redis

DB Adapters

Ready-to-subclass base repositories for SQL (async/sync), MongoDB (Motor) and Redis — with serialization included.

BaseAsyncRepository · BaseMongoRepository · BaseRedisRepository

Ready in 30 seconds

Install, inherit, ship.

terminal
# 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
{% endblock %}