Skip to main content

A framework to automate reacting to ActivityStreams events.

Project description

Mechanical Bull

Mechanical Bull is an ActivityPub Client application build based on bovine. It's main goal is to provide a platform for automating activities undertaking in the FediVerse. Furthermore, it serves as a demonstration how ActivityPub Clients can be build with bovine.

Installation

One can simply install mechanical_bull with pip via

pip install mechanical-bull

Once can then add a new user by running

python -m mechanical_bull.add_user

This will then ask you to enter a name, the hostname, your ActivityPub Actor lives on, then prompt you to add a new did:key to your ActivityPub Actor. This did:key will be used to authenticate mechanical_bull against your server. Once you have added the key, press enter, and mechanical_bull is running. This method of authentication is called Moo-Auth-1 and described here.

The configuration is saved in config.toml. bovine also supports authentication through private keys and HTTP signatures. For the details on how to configure this, please consult bovine. You can add further automations there.

Then you should be able to run mechanical bull via

python -m mechanical_bull.run

Writing automations

The examples of mechanical_bull.actions.handle_follow_request and mechanical_bull.actions.log_to_file should show how to write a new automation. The basic idea is that each file contains a function handle with signature

async def handle(client: BovineClient, data: dict, **kwargs):
    return

here the kwargs are the dict given by the definiton in the handler block, i.e.

[user.handlers]
"my.package" = { arg1 = "value1", arg2 = "value2 }

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

mechanical_bull-0.0.3.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

mechanical_bull-0.0.3-py3-none-any.whl (7.4 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