Updated README.md

master
Douglas Blank 2018-07-24 17:34:50 -04:00
rodzic 39fe6afc39
commit da8d6af5e6
1 zmienionych plików z 45 dodań i 5 usunięć

Wyświetl plik

@ -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.