activitypub
Install
You can install the development version of activitypub with:
pip install git+git://github.com/dsblank/activitypub
or the last packaged version with:
pip install activitypub
To use with redis:
pip install redis redis_collections
OR to use with mongodb:
pip install pymongo
OR to use with SQLAlchemy:
pip install sqlalchemy
Abstractions
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 API
These levels can be used independently, or together. They can best be used together using a Manager:
>>> from activitypub.manager import Manager
>>> from activitypub.database import ListDatabase
>>> db = ListDatabase()
>>> 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'}
>>> 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 MongoDB.
activitypub is targeting the following web frameworks:
Flask
Tornado
Others can be supported. Please ask!
The activitypub webservice API is based on Flask’s.
Metadata
Release files for activitypub 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| activitypub-0.0.3.tar.gz | 32.0 kB | Without provenance | Details for activitypub-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| activitypub-0.0.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for activitypub-0.0.3-py2.py3-none-any.whl |
Total release size: 74.5 kB
Release files / activitypub-0.0.3.tar.gz
| Download URL | activitypub-0.0.3.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81f02761097fa9bacb8490a1a6f8cf61ae96bc100c74775046ea441082b69510
|
|
BLAKE2b-256 checksum How to use checksums |
8075b2efd7c9a71c190ad2b10c5b01e841787a6466dea9946fa3846cd839a819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Release files / activitypub-0.0.3-py2.py3-none-any.whl
| Download URL | activitypub-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 42.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
68efb25c0f8a64ccab8f86302d9fc2d001a8ce164501bddd2218e69b582adbf7
|
|
BLAKE2b-256 checksum How to use checksums |
a842994effdea023d736eef62bd8a1ca02c26af3b8a945823fff06ddee309f90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Security for activitypub 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.