Activity Streams 2 Documentation

Activity Streams 2

Build Status Coverage Status Documentation Project on PyPI

activitystreams2 is a python library for producing Activity Streams 2.0 content. It doesn‘t have a lot of features (no extensions) but aims to be give correct results and be easy to understand.

At the moment, only supports writing activity streams.

Installing

The recommended way of manually installing activitystreams2 is via pip

pip3 install activitystreams2

Examples

import activitystreams2

martin = activitystreams2.Actor(id='http://www.test.example/martin')
activity = activitystreams2.Create(
    actor=martin,
    summary='Martin created an image',
    object='http://example.org/foo.jpg',
)
# do this to serialize it
json_string = str(activity)

Caveats

We completely don’t support extension types at the moment.

Alternatives

The only python Activity Streams 2 library I know of is activipy. It supports extension types, but it‘s still pre-alpha and seems to have been forgotten.

Changes

0.5

  • Rename to activitystreams2
  • Add api documentation

0.4.1

  • Document upcoming name change
  • Drop PBR and switch to using a package

0.4

  • Add rudimentary support for extension properties

0.3

  • Fix bug printing collections with only 1 item

0.2.0

  • Add support for ActivityPub extension

0.1.0

  • Initial version

API Documentation

Information on specific functions, classes, and methods.

Indices and tables