Powerful Toolkit for ActivityPub Implementations.
Project description
Powerful Toolkit for ActivityPub Implementations.
Documentation: https://fedi-libs.github.io/apkit
Source Code: https://github.com/fedi-libs/apkit
[!WARNING] apkit is not stable. API changes with no regard for backward compatibility and new releases are sometimes made at short intervals.
apkit is a modern, fast, and powerful toolkit for building ActivityPub-based applications with Python, based on standard Python type hints.
The key features are:
- FastAPI-based Server: Build high-performance, production-ready ActivityPub servers with the power and simplicity of FastAPI.
- Async Client: Interact with other Fediverse servers using a modern
asyncHTTP client. - Built-in Helpers: Simplified setup for Webfinger, NodeInfo, HTTP Signatures, and other Fediverse protocols.
- Extensible: Designed to be flexible and easy to extend for your own custom ActivityPub logic.
Requirements
- Python 3.12+
- FastAPI for the server part.
- apmodel for ActivityPub models.
- apsig for HTTP Signatures.
Installation
pip install apkit
To include the server components (based on FastAPI), install with the server extra:
pip install "apkit[server]"
Example
Create a simple ActivityPub actor and serve it:
from apkit.models import Person
from apkit.server import ActivityPubServer
from apkit.server.responses import ActivityResponse
app = ActivityPubServer()
HOST = "example.com"
actor = Person(
id=f"https://{HOST}/actor",
name="apkit Demo",
preferredUsername="demo",
inbox=f"https://{HOST}/inbox",
)
@app.get("/actor")
async def get_actor():
return ActivityResponse(actor)
Run the server with uvicorn:
$ uvicorn main:app
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apkit-0.3.7.tar.gz.
File metadata
- Download URL: apkit-0.3.7.tar.gz
- Upload date:
- Size: 189.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ffd4c064324ccee8977f32e0e14a19264f7ea469dc0ba6b6af22310672e8e3d
|
|
| MD5 |
d3bedd0337b1595d9e004f838a52fffa
|
|
| BLAKE2b-256 |
c2df12e77163b2de781fb16daf4da352007a97bf3caacf672675f1e3c740d250
|
Provenance
The following attestation bundles were made for apkit-0.3.7.tar.gz:
Publisher:
publish.yml on fedi-libs/apkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apkit-0.3.7.tar.gz -
Subject digest:
9ffd4c064324ccee8977f32e0e14a19264f7ea469dc0ba6b6af22310672e8e3d - Sigstore transparency entry: 784474635
- Sigstore integration time:
-
Permalink:
fedi-libs/apkit@99f314dee440d6d4d1c640ba95451cf6ff24dedf -
Branch / Tag:
refs/tags/v0.3.7 - Owner: https://github.com/fedi-libs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@99f314dee440d6d4d1c640ba95451cf6ff24dedf -
Trigger Event:
release
-
Statement type:
File details
Details for the file apkit-0.3.7-py3-none-any.whl.
File metadata
- Download URL: apkit-0.3.7-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1e8ea520a0332afaa142f80a44b40ced5d66fc51b6ec9827dc6c115a214958d
|
|
| MD5 |
9f454d4cfbe8805b4b593c6e1b586766
|
|
| BLAKE2b-256 |
f1ff48539ae165f13dd43bf74ffb13c839648ab98b9e893ec60409d572bb6405
|
Provenance
The following attestation bundles were made for apkit-0.3.7-py3-none-any.whl:
Publisher:
publish.yml on fedi-libs/apkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apkit-0.3.7-py3-none-any.whl -
Subject digest:
b1e8ea520a0332afaa142f80a44b40ced5d66fc51b6ec9827dc6c115a214958d - Sigstore transparency entry: 784474712
- Sigstore integration time:
-
Permalink:
fedi-libs/apkit@99f314dee440d6d4d1c640ba95451cf6ff24dedf -
Branch / Tag:
refs/tags/v0.3.7 - Owner: https://github.com/fedi-libs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@99f314dee440d6d4d1c640ba95451cf6ff24dedf -
Trigger Event:
release
-
Statement type: