arkitekt-fastapi
Server mode for an Arkitekt app: serve an app declared with arkitekt-spec as an HTTP service.
from fastapi import FastAPI
from arkitekt_fastapi import configure_fastapi
app = FastAPI()
configure_fastapi(app=app, app_registry=registry, db_file="journal.db")
Every declared action becomes a route with an OpenAPI schema generated from its ports; states, locks, tasks and the journal are served alongside. It runs actions on arkitekt-runtime's execution core, the same one rekuest's distributed agent uses, but with an in-process transport: no websockets, no rath, no rekuest server.
A served app registers with no one and so cannot call other actions: Task.call raises
NoCallerError at once.
Assets
The files an app registers with register_asset are served by the name its bloks call them
by (@self.assets.<name>):
GET /schemas/assetslists them as they are declared: name, kind, reference, and the size or the source.GET /assets/<name>is the file, with its reference as theETag(If-None-Matchanswers 304). An asset registered with asourceis not held by the app: the route redirects (307) to that source and fetches nothing.
A file that changed on disk since it was registered is refused with 409, since a reader checks
the bytes against the reference. Like the schema routes, the asset routes ask for no user.
configure_fastapi(..., add_assets=False) leaves them out; assets_path= moves them.
AsyncAgentTestClient drives a served app in tests without a network.
Metadata
Release files for arkitekt-fastapi 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arkitekt_fastapi-2.1.0.tar.gz | 45.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arkitekt_fastapi-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 104.3 kB
Release files / arkitekt_fastapi-2.1.0.tar.gz
| Download URL | arkitekt_fastapi-2.1.0.tar.gz |
|---|---|
| Size | 45.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3a6f4f0b761c1549623b7fb9fd5fe252b23dd7556c14468cb61285dc3e9c5c4
|
|
BLAKE2b-256 checksum How to use checksums |
c26d4fabd0b0fad4ce0aaac4a8bdb8ee1c0187db4ea933fe6ce8e055b8961a81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / arkitekt_fastapi-2.1.0-py3-none-any.whl
| Download URL | arkitekt_fastapi-2.1.0-py3-none-any.whl |
|---|---|
| Size | 58.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1a3e06d5f45b1cd172dd9cc3038e9697e9de20165531835ac65b8fec83d2e44
|
|
BLAKE2b-256 checksum How to use checksums |
d90c2e1ed48b70f4c00853008ab2a47225dfe738c3bc79506f8982e43953327e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|