apkit: Modularized ActivityPub framework/toolki for Python

Hello, everyone!

I made ActivityPub toolkit/framework for Python. test and documentation are incomplete (or nothing), but testing with Iceshrimp and Fedify (signature only) has confirmed that sending and receiving activities functions correctly.

Currently features:

  • ActivityPub Client: apkit includes an aiohttp-based ActivityPub Client.
  • HTTP Signature/RSASignature2017 (LDSignature)/FEP-8b32: apkit (To be precise, apsig) provides a verify/sign with HTTP Signature, LDSignature and FEP-8b32. In the future, supports RFC9421.
  • ActivityPub Server: apkit provides FastAPI-based server!
  • Of course, apkit is modularized, you can use sign and verify with apsig or, access activitystreams model with apmodel, without apkit.

In the future:

  • Integration with any web frameworks: Now, apkit not supported integrate with any web framework (e.g. Django, aiohttp) because, I can’t implemented satisfactory implemention with middleware-based approach. (In the past, apkit supported starlette and litestar with middleware-based approach.)
  • Fully-Synchronous support (exclude server): apkit partially provides synchronous api but, apkit’s client isn’t provide synchronous support yet.
  • Signing to GET request: apsig does not supported signing and verifying to request. this restriction is maybe cause any issues to federation. (likely, Mastodon with AUTHORIZED_FETCH enabled, GoToSocial)

I still feel this library is immature and rough around the edges. Suggestions for improvements, feature additions, and requests are more than welcome!

GitHub:

Reminder bot sample:

have fun!

6 Likes

So great to see apkit officially introduced here! I’ve been following your progress on the fediverse and it’s impressive how far you’ve come. The Python ActivityPub ecosystem really needed this. Well done!

1 Like