Components
This page lists each xtr package by the job that it does. Each package has a
README with its full description and its examples. The API reference shows its
classes and functions.
To add a package to an application, read Add a package .
To use a package alone, install it with uv add and read its README.
Application and kernel
Package
What it does
API
xtr-dependency-injection
Collects the bundles of an application and builds its container. It also runs the start and the stop of the application.
API
xtr-console
Async console applications. A command is a function or a class, and the container gives it its services.
API
xtr-cli
Makes a new console application or web application in one command, and serves it.
API
xtr-recipes
Applies the recipe of each package to a project, and undoes it when you remove the package.
API
xtr-maker
Console commands that write the files of a message, an entity, a command or a listener. It refuses a file that exists.
API
xtr-dotenv
Loads layers of .env files into the environment. It also gives the same layers as a typed settings model.
API
xtr-logging
Channels, handlers, processors and formatters behind one logger interface.
API
xtr-clock
A clock that the container gives to your code, a date and time with a time zone, and a frozen clock for tests.
API
xtr-stopwatch
Measures named events in sections. Each request that runs at the same time keeps its own events.
API
HTTP
Package
What it does
API
xtr-http-kernel
Serves a FastAPI application from the kernel. Events turn each request into a response.
API
xtr-web-profiler
In development, shows a toolbar on each page and a profile of each request: time, logs, events, route and errors.
API
xtr-http-foundation
Matchers for a request, tools for IP networks, and the session of a request.
API
xtr-http-message
HTTP requests, responses, streams, URIs and uploaded files, with one factory for all of them.
API
xtr-http-client
An async HTTP client with typed options, scoped clients, retries, a guard for private networks and a mock client for tests.
API
Security
Package
What it does
API
xtr-security
The bundle of the security family. It configures and connects the security components.
API
xtr-security-core
Users, tokens, roles, voters and the authorization decision.
API
xtr-security-http
Firewalls, authenticators and bearer access tokens for HTTP requests.
API
xtr-security-csrf
Protection against cross-site request forgery: it makes and checks tokens, and keeps them in the session.
API
xtr-password-hasher
Password hashes behind one interface. The default is argon2id. It also upgrades old hashes.
API
xtr-security-jwt
JSON Web Tokens that the application signs: key sets, an encoder and a token manager.
API
xtr-security-oauth2-server
An OAuth 2.0 authorization server, and an authenticator for a resource server.
API
xtr-security-oauth2-server-core
The library of the OAuth 2.0 server: grants, servers, entities and response types.
API
xtr-security-openid-connect-server
OpenID Connect on the OAuth 2.0 server: ID tokens, a userinfo endpoint and a configuration document.
API
Messages, events and workflows
Package
What it does
API
xtr-messenger
A message bus with envelopes, stamps, a chain of middleware and transports.
API
xtr-amqp-messenger
A message bus transport on a RabbitMQ broker.
API
xtr-scheduler
Recurring messages on the message bus, with cron and periodic triggers.
API
xtr-event-dispatcher
Sends events to listeners and subscribers by priority. A listener can stop the event.
API
xtr-remote-event
Events from other systems, as one value type, sent to the consumer of their source.
API
xtr-webhook
Receives webhooks as events after it checks them, and sends signed webhooks.
API
xtr-workflow
Moves objects through workflows and state machines, with guards and events at each step.
API
Data and resources
Package
What it does
API
xtr-orm
Async database engines, sessions and versioned schema migrations.
API
xtr-orm-messenger
A message bus transport that keeps its messages in a database table.
API
xtr-cache
Cache pools in memory, in files or in Redis, with tags and protection against a stampede.
API
xtr-storage
Files on a local disk, in memory or in object stores, behind one async interface.
API
xtr-lock
Exclusive and shared locks in memory, in files, in Redis or in more than one store.
API
xtr-rate-limiter
Limits on how often an action can occur, by fixed window, sliding window or token bucket.
API
xtr-serializer
Changes objects to JSON and JSON to objects. It refuses each value that it cannot change back to an equal value.
API
Language models
Package
What it does
API
xtr-ai
Language-model platforms and agents on pydantic-ai. You configure them once, and the container gives each agent by its name.
API
xtr-ai-orm-conversation-store
Keeps the conversations of agents in database tables.
API
Notifications
Email
Package
What it does
API
xtr-mailer
Sends email through SMTP, sendmail or the API of a provider. A DSN configures each transport. It sends at once or through the message bus.
API
xtr-mime
Makes email messages with addresses, headers, text and HTML bodies, attachments and inline images. It writes them as standard MIME. It can also sign them with DKIM or S/MIME.
API
Contracts
Each contracts package contains only interfaces. Contracts
describes why they exist.