Skip to main content

Powerful Toolkit for ActivityPub Implementations.

Project description

apkit

Powerful Toolkit for ActivityPub Implementations.

Test Package version pre-commit.ci status Ask DeepWiki


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 async HTTP 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apkit-0.3.7.tar.gz (189.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apkit-0.3.7-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

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

Hashes for apkit-0.3.7.tar.gz
Algorithm Hash digest
SHA256 9ffd4c064324ccee8977f32e0e14a19264f7ea469dc0ba6b6af22310672e8e3d
MD5 d3bedd0337b1595d9e004f838a52fffa
BLAKE2b-256 c2df12e77163b2de781fb16daf4da352007a97bf3caacf672675f1e3c740d250

See more details on using hashes here.

Provenance

The following attestation bundles were made for apkit-0.3.7.tar.gz:

Publisher: publish.yml on fedi-libs/apkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for apkit-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b1e8ea520a0332afaa142f80a44b40ced5d66fc51b6ec9827dc6c115a214958d
MD5 9f454d4cfbe8805b4b593c6e1b586766
BLAKE2b-256 f1ff48539ae165f13dd43bf74ffb13c839648ab98b9e893ec60409d572bb6405

See more details on using hashes here.

Provenance

The following attestation bundles were made for apkit-0.3.7-py3-none-any.whl:

Publisher: publish.yml on fedi-libs/apkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page