diff --git a/README.md b/README.md index 5523a1b..268179b 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ This module is designed to be a generally useful ActivityPub library in Python. * ActivityPub object API * ActivityPub database API -* Webserver +* Webserver API -The first two levels can be used indpendently, or together. They can best be used toegether using a Manager: +These levels can be used independently, or together. They can best be used together using a Manager: ```python ->>> from activitypub import Manager ->>> from activitypub.database import DummyDatabase ->>> db = DummyDatabase() +>>> from activitypub.manager import Manager +>>> from activitypub.database import ListDatabase +>>> db = ListDatabase() >>> manager = Manager(database=db) >>> p = manager.Person(id="alyssa") >>> p.to_dict() @@ -26,4 +26,44 @@ The first two levels can be used indpendently, or together. They can best be use 'outbox': 'https://example.com/alyssa/outbox', 'type': 'Person', 'url': 'https://example.com/alyssa'} +>>> db.actors.insert_one(p.to_dict()) +>>> db.actors.find_one({"id": 'https://example.com/alyssa'}) +{'@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', + '_id': ObjectId('5b579aee1342a3230c18fbf7')} ``` + +activitypub supports the following databases: + +* MongoDB +* SQL dialects --- any that that sqlalchemy supports, including: + * SQLite (including in-memory) + * Firebird + * Microsoft SQL Server + * MySQL + * Oracle + * PostgreSQL + * Sybase + * ... and many more! +* An in-memory, JSON-based database for testing +* Redis + +The activitypub database API is a subset of the MongDB. + +activitypub is targeting the following web frameworks: + +* Flask +* Tornado + +Others can be supported. Please ask! + +The activitypub webservice API is based on Flask's.