Tiny ActivityPub framework written in Python, both database and server agnostic.
Go to file
Thomas Sileo 4f0ffc2445 Cleanup 2018-06-12 19:57:40 +02:00
little_boxes Cleanup 2018-06-12 19:57:40 +02:00
tests Cleanup 2018-06-12 19:57:40 +02:00
.gitignore Cleanup 2018-06-12 19:57:40 +02:00
.travis.yml Cleanup 2018-06-12 19:57:40 +02:00
LICENSE Initial commit 2018-06-11 22:50:02 +02:00
MANIFEST.in Cleanup 2018-06-12 19:57:40 +02:00
README.md Cleanup 2018-06-12 19:57:40 +02:00
dev-requirements.txt Cleanup 2018-06-12 19:57:40 +02:00
requirements.txt Cleanup 2018-06-12 19:57:40 +02:00
setup.cfg Initial commit 2018-06-11 22:50:02 +02:00
setup.py Cleanup 2018-06-12 19:57:40 +02:00

README.md

Little Boxes

Build Status License

Tiny ActivityPub framework written in Python, both database and server agnostic.

Still in early development, and not published on PyPI yet.

Getting Started

from little_boxes import activitypub as ap

from mydb import db_client


class MyBackend(BaseBackend):

    def __init__(self, db_connection):
        self.db_connection = db_connection    

    def inbox_new(self, as_actor, activity):
        # Save activity as "as_actor"
        # [...]

    def post_to_remote_inbox(self, as_actor, payload, recipient):
        # Send the activity to the remote actor
        # [...]


db_con = db_client()
my_backend = MyBackend(db_con)

ap.use_backend(my_backend)

me = ap.Person({})  # Init an actor
outbox = ap.Outbox(me)

follow = ap.Follow(actor=me, object='http://iri-i-want-follow')
outbox.post(follow)

Projects using Little Boxes

Contributions

TODO: document Mypy, flake8 and black.

PRs are welcome, please open an issue to start a discussion before your start any work.