Update README.md

master
Doug Blank 2018-07-19 08:45:34 -04:00 zatwierdzone przez GitHub
rodzic 5f9f5f22b6
commit 962ab12ab4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 25 dodań i 4 usunięć

Wyświetl plik

@ -1,7 +1,28 @@
# ActivityPub
# activitypub
Prototyping a Python ActivityPub distributed server in Tornado
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:
```
python -m activitypub
```
>>> from activitypub import DummyDatabase, Manager
>>> 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'}
```