Skip to main content

Yet another cross-posting tool in Python

Project description

Barkr

Barkr[^1] is a social media cross-posting tool written in Python: set it up and never worry about manually posting the same message to multiple channels ever again!

With Barkr you can setup a series of channels (e.g. social media accounts) to read messages from and / or post messages to. You can mix and match read / write modes, and add multiple accounts of the same type of channel as well without worrying that the same message will be re-posted to a channel it comes from.

Note that Barkr is limited to text posts only. Want to see that change? Start a discussion on a new issue!

[^1]: "Barkr" (missing "e") as in "entity that barks". See: dogs.

Motivation

I wrote Barkr for a personal use case after noting how much fragmentation there currently is (as of 2023) in the social media space, as a way to reduce the cost of engaging with multiple social media platforms, and also as a (very simple) way to practice using threads in Python.

Installation

Use the package manager pip to install barkr.

pip install barkr

Usage

Create a Python script and specify all the channels you want to use. Channel connections are present in the barkr.connections module.

A simple script showcasing how to set up three Mastodon connections with multiple modes that can run in the background is outlined below:

from barkr.main import Barkr
from barkr.connections.base import ConnectionModes
from barkr.connections.mastodon import MastodonConnection

barkr = Barkr(
    [
        # Barkr will read new messages posted by this account, and queue them to
        # other accounts on write mode, but will not post anything to it.
        MastodonConnection(
            "Read only connection",
            [ConnectionModes.READ],
            "<ACCESS TOKEN HERE>",
            "<INSTANCE URL HERE>",
        ),
        # Barkr will write queued messages to this account, but will not read anything
        # new posted to this account or queue anything from this account to other ones
        MastodonConnection(
            "Write only connection",
            [ConnectionModes.WRITE],
            "<ACCESS TOKEN HERE>",
            "<INSTANCE URL HERE>",
        ),
        # Barkr will read new messages from this account to be queued onto others, and will
        # post new messages from other channels into this one as well.
        MastodonConnection(
            "R/W connection",
            [ConnectionModes.READ, ConnectionModes.WRITE],
            "<ACCESS TOKEN HERE>",
            "<INSTANCE URL HERE>",
        ),
    ]
)
barkr.start()

Always keep in mind proper secret management practices when using Barkr: instead of hardcoding access tokens / cookies / user and passwords, use tools like environment variables, dotenv or other secret managers!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Contributions for issues that are already open by maintainers are welcome and encouraged.

Please make sure to update tests as appropriate; a minimum coverage of 80% is expected (and enforced by Github Actions!).

License

This project is licensed under the GNU Affero General Public License v3.0.

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

barkr-0.1.2.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

barkr-0.1.2-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file barkr-0.1.2.tar.gz.

File metadata

  • Download URL: barkr-0.1.2.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for barkr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5d1cadcbeab836c1eb12a327c3ef0d112b3d292d1143881c253db88f278d2c6b
MD5 797360fafb09bb47cf86a6ba8f46b9b2
BLAKE2b-256 4a5db98fd693e78797b25b2bfef0b22c608640f5f5b202dcf005d45452a81983

See more details on using hashes here.

File details

Details for the file barkr-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: barkr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for barkr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e02e45ec3534ecbf268befedcbdd563a26089890b59c20433561ace19ae7a1c1
MD5 c995d3bc332daf4ef40bc08283f13e0a
BLAKE2b-256 8f3ec7eaaf07c8297d60e0c4377a83f448c9438db4ef859abe89a09b222a7e23

See more details on using hashes here.

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