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
activity
is composed ofobjects
. - An
activity
must define anactor
,verb
andobject
. - An
object
must define anobjectType
and adisplayName
objects
andactivities
may contain arbitrary attributes.
Sunspear also implements parts of some extensions to the specificiations. More specifically, Audience Targeting and Responses.