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.app 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.8.tar.gz (188.1 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.8-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file apkit-0.3.8.tar.gz.

File metadata

  • Download URL: apkit-0.3.8.tar.gz
  • Upload date:
  • Size: 188.1 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.8.tar.gz
Algorithm Hash digest
SHA256 aeed556b22bdc26e0dbe0f36c958cafdd0584c176e6fa59a8da0d7dae482c02d
MD5 7fc521fe00e0b9fa81f795e88ea98555
BLAKE2b-256 b2b9ac354517ce7774b3cd3b7e15c0da57566ccd289ed2e132a77d80120e4ff1

See more details on using hashes here.

Provenance

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

Publisher: deploy.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.8-py3-none-any.whl.

File metadata

  • Download URL: apkit-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 33.7 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0603f636de2eff232644da01179fd1dc72e6e94ad186f61a3c1335f1f964d61d
MD5 39a31c8057aaffcdbc769b9b5d44b671
BLAKE2b-256 0db4a7a6060dd38a4fe40097c27dd3b6184df54ff1aa32c7dc06198a080b7bcf

See more details on using hashes here.

Provenance

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

Publisher: deploy.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