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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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