Skip to main content

Minimal inplementation of ActivityPub Interface

Project description

`Repo <https://codeberg.org/MarvinsMastodonTools/minimal-activitypub>`_ `Downloads <https://pepy.tech/project/minimal-activitypub>`_ `Code style: black <https://github.com/psf/black>`_ `Checked against <https://pyup.io/safety/>`_ `Checked with <https://pypi.org/project/pip-audit/>`_ PyPI - Python Version PyPI - Wheel `CI / Woodpecker <https://ci.codeberg.org/MarvinsMastodonTools/minimal-activitypub>`_ `AGLP 3 or later <https://codeberg.org/MarvinsMastodonTools/minimal-activitypub/src/branch/main/LICENSE.md>`_

Minimal-ActivityPub is a minimal Python implementation of the ActivityPub rest API used by Mastodon, Pleroma, and others. This implementation makes use of asyncio where appropriate. It is intended to be used as a library by other applications. No standalone functionality is provided.

Minimal refers to the fact that only API calls I need for my other projects; MastodonAmnesia and TootBot are implemented.

DO NOT expect a full or complete implementation of all ActivityPub API functionality.

API Methods Implemented currently

Client to Server Methods

  • get_auth_token

  • verify_credentials

  • determine_instance_type

  • get_account_statuses

  • delete_status

Server to Server Methods

No API methods for server to server communications have been implemented.

Usage

Minimal-ActivityPub is available on PyPi as minimal-activitypub and can be added to an application the same as any other python library.

Add minimal-activitypub as a requirement to your project and/or install using pip:

pip install minimal-activitypub

Workflow overview

In general you need the authenticate to an ActivityPub server instance. To do so you require an access_token, so generally you’ll want to use the method get_auth_token when setting up the initial connection.

After that I think it is a good idea to verify the credentials using the verify_credentials method and determine the server type using the determine_instance_type method.

After that you use which ever method(s) that are needed for your use case.

Contributing

Minimal-ActivityPub is using Poetry for dependency control, please install Poetry if you’d like to contribute.

To make sure you have all required python modules installed with Poetry is as easy as poetry install in the root of the project directory

Licensing

Minimal-ActivityPub is licences under licensed under the GNU Affero General Public License v3.0

Supporting Minimal-ActivityPub

There are a number of ways you can support Minimal-ActivityPub:

  • Create an issue with problems or ideas you have with/for Minimal-ActivityPub

  • You can buy me a coffee.

  • You can send me small change in Monero to the address below:

Monero donation address:

8ADQkCya3orL178dADn4bnKuF1JuVGEG97HPRgmXgmZ2cZFSkWU9M2v7BssEGeTRNN2V5p6bSyHa83nrdu1XffDX3cnjKVu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minimal-activitypub-0.2.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

minimal_activitypub-0.2.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file minimal-activitypub-0.2.1.tar.gz.

File metadata

  • Download URL: minimal-activitypub-0.2.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.10.141-1-MANJARO

File hashes

Hashes for minimal-activitypub-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f6905d94709ddae41d4c851b5385eaab35934f46a83787ebbeff1bdfb407fff3
MD5 e53bfc7a5b2c490065dac9ffd1b405c9
BLAKE2b-256 5c53b5589a37993ff3482b27713535121a836c9f65d8ad09ed3efc758061886d

See more details on using hashes here.

File details

Details for the file minimal_activitypub-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: minimal_activitypub-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.10.141-1-MANJARO

File hashes

Hashes for minimal_activitypub-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f574cf1bfe21964bed23a5a43da65c31c5fd7d603c9b9f5fec8a40f5a34bfddc
MD5 26603d7ef4157c50158c929fd1619792
BLAKE2b-256 7ff8a78ad9c1c2f89c9ce0a3886da224d8b31b3bedb570a4ef6713ec0202ed0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page