This is a Python library to use with ActivityPub. ActivityPub is an API for an open, distributed, social network.
 
 
 
Go to file
Douglas Blank 851af921fa Refactor database; added MongoDatabase 2018-07-19 09:45:11 -04:00
activitypub Refactor database; added MongoDatabase 2018-07-19 09:45:11 -04:00
static Handles messages in JavaScript and in Python for current user 2018-05-21 11:38:18 -04:00
templates Rework into separate layers: ActivityPub, Manager with Database as abstraction 2018-07-18 12:45:25 -04:00
.gitignore
LICENSE
README.md Refactor database; added MongoDatabase 2018-07-19 09:45:11 -04:00
requirements.txt Login, username, password, and logout implemented 2018-04-22 23:02:35 -04:00

README.md

activitypub

This module is designed to be a generally useful ActivityPub library in Python. It targets three different levels of use:

  • ActivityPub object API
  • ActivityPub database API
  • Webserver

The first two levels can be used indpendently, or together. They can best be used toegether using a Manager:

>>> from activitypub import Manager
>>> from activitypub.database import DummyDatabase
>>> db = DummyDatabase()
>>> manager = Manager(database=db)
>>> p = manager.Person(id="alyssa")
>>> p.to_dict()
{'@context': 'https://www.w3.org/ns/activitystreams',
 'endpoints': {},
 'followers': 'https://example.com/alyssa/followers',
 'following': 'https://example.com/alyssa/following',
 'id': 'https://example.com/alyssa',
 'inbox': 'https://example.com/alyssa/inbox',
 'liked': 'https://example.com/alyssa/liked',
 'likes': 'https://example.com/alyssa/likes',
 'outbox': 'https://example.com/alyssa/outbox',
 'type': 'Person',
 'url': 'https://example.com/alyssa'}