Skip to main content

A simple Matrix bot that fetches Bible verses

Project description

Matrix BibleBot

A simple Matrix bot that fetches Bible verses using APIs from bible-api.com & esv.org

PyPI version Python Tests

Supported Translations

  • King James Version (KJV)
  • English Standard Version (ESV) - requires an API key
  • Easily extensible to support additional translations

Installation

Install from PyPI (Recommended)

pip install matrix-biblebot

For an isolated installation, you can use pipx:

pipx install matrix-biblebot

Install from Source

Clone the repository:

git clone https://github.com/jeremiah-k/matrix-biblebot.git
cd matrix-biblebot
pip install .

For development:

pip install -e .

Configuration

1. Create a .env file

Create a .env file in the same directory as your config file (e.g., ~/.config/matrix-biblebot/.env) with your Matrix access token and any API keys:

MATRIX_ACCESS_TOKEN="your_bots_matrix_access_token_here"
ESV_API_KEY="your_esv_api_key_here"  # Optional

The bot will first look for a .env file in the same directory as your config file. If not found, it will fall back to looking in the current working directory.

2. Create a config.yaml file

The bot looks for a configuration file at ~/.config/matrix-biblebot/config.yaml by default. You can generate a template configuration file with:

biblebot --generate-config

This will create a sample config file with the following structure:

matrix_homeserver: "https://your_homeserver_url_here"
matrix_user: "@your_bot_username:your_homeserver_domain"
matrix_room_ids:
  - "!your_room_id:your_homeserver_domain"
  - "!your_other_room_id:your_homeserver_domain"

Edit this file with your Matrix credentials and room IDs.

You can also specify a custom config location:

biblebot --config /path/to/your/config.yaml

Or generate a config at a custom location:

biblebot --generate-config --config /path/to/your/config.yaml

Usage

Running the Bot

After installation and configuration, you can run the bot with:

biblebot

Or with custom options:

biblebot --config /path/to/config.yaml --log-level debug

Command-line Options

usage: biblebot [-h] [--config CONFIG] [--log-level {error,warning,info,debug}] [--generate-config] [--version]

BibleBot for Matrix

options:
  -h, --help            show this help message and exit
  --config CONFIG       Path to config file (default: ~/.config/matrix-biblebot/config.yaml)
  --log-level {error,warning,info,debug}
                        Set logging level (default: info)
  --generate-config     Generate a sample config file at the specified path
  --version             show program's version number and exit

Interacting with the Bot

Invite the bot to rooms that are listed in the config.yaml file. The bot will respond to messages that match Bible verse references:

  • Simple reference: John 3:16
  • Range reference: 1 Cor 15:1-4
  • With translation: John 3:16 esv

Development

Contributions are welcome! Feel free to open issues or submit pull requests.

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

matrix_biblebot-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matrix_biblebot-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file matrix_biblebot-0.1.0.tar.gz.

File metadata

  • Download URL: matrix_biblebot-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for matrix_biblebot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cce9064d61cc0a68b770bb82d8fd2d65ef727021f23110c591887f795abb56dd
MD5 536a2a8dbd5d40b97f455b9c8898bdea
BLAKE2b-256 61a487b6af7bc7dd7d1452cdd13f05351e2c64005194d74833e897307e5eae51

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrix_biblebot-0.1.0.tar.gz:

Publisher: pypi-publish.yml on jeremiah-k/matrix-biblebot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file matrix_biblebot-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for matrix_biblebot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ebe14389660be170d184f4c632f884246352c90e54e904d12fb172b3e7315c4
MD5 cb00395e9d8f56b84cb83a7c78cbcf64
BLAKE2b-256 5554f059890c068a6c407c38b59b402171baced12fca6fa8a1d1f2beac451254

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrix_biblebot-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on jeremiah-k/matrix-biblebot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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