Introduction¶
Sunspear is a python library which provides an API to store and manage activity stream items.
What it is¶
Sunspear is a library which allows you to add feeds and activity streams to your applications. It serializes these activities and feed items as described in the JSON Activity Stream 1.0 specifications.
The specifications look scary, dull and boring (and they are), but essentially, an activity for:
``John Doe`` added ``Jane Doe`` to the group ``Party Planning``
boils down to:
{
"actor": {
"objectType": "user",
"displayName": "John Doe",
"id": "user:1234", # Totally optional, it will be generated for you if you don't provide one.
"title": "Manager",
"foo": "bar"
},
"object": {
"objectType": "user",
"displayName": "Jane Doe",
"title": "Devloper",
"foo": "baz"
},
"target": {
"objectType": "group",
"displayName": "Party Planning"
},
"bar": "bee",
"verb": "added"
}
The main takeaway points are:
- An
activityis composed ofobjects. - An
activitymust define anactor,verbandobject. - An
objectmust define anobjectTypeand adisplayName objectsandactivitiesmay contain arbitrary attributes.
Sunspear also implements parts of some extensions to the specificiations. More specifically, Audience Targeting and Responses.