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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matrix_biblebot-0.1.1.tar.gz.
File metadata
- Download URL: matrix_biblebot-0.1.1.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97f65dd0ccadd4f829327ea41774a7b41f7ad78b7f406c769d9bc9ef22bb52fd
|
|
| MD5 |
98dd1a1ee3704733c33971d7c7dc329c
|
|
| BLAKE2b-256 |
da47084d95808bd4c9e1528d83cacad8ab58da77092a03a09fac9a393558a26e
|
Provenance
The following attestation bundles were made for matrix_biblebot-0.1.1.tar.gz:
Publisher:
pypi-publish.yml on jeremiah-k/matrix-biblebot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matrix_biblebot-0.1.1.tar.gz -
Subject digest:
97f65dd0ccadd4f829327ea41774a7b41f7ad78b7f406c769d9bc9ef22bb52fd - Sigstore transparency entry: 213051791
- Sigstore integration time:
-
Permalink:
jeremiah-k/matrix-biblebot@0505357913b0467408a205af8da75d10dd0a427b -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/jeremiah-k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@0505357913b0467408a205af8da75d10dd0a427b -
Trigger Event:
release
-
Statement type:
File details
Details for the file matrix_biblebot-0.1.1-py3-none-any.whl.
File metadata
- Download URL: matrix_biblebot-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2290154eae53f5eea7f699020265f38465acd55595dd066051f7e5950d7e470
|
|
| MD5 |
13089dee485ebed157e1978646ffd57c
|
|
| BLAKE2b-256 |
a7681fe96dde3694012468276ab4918b9c0c4066ff0d03419ba5806b849c976f
|
Provenance
The following attestation bundles were made for matrix_biblebot-0.1.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on jeremiah-k/matrix-biblebot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matrix_biblebot-0.1.1-py3-none-any.whl -
Subject digest:
b2290154eae53f5eea7f699020265f38465acd55595dd066051f7e5950d7e470 - Sigstore transparency entry: 213051794
- Sigstore integration time:
-
Permalink:
jeremiah-k/matrix-biblebot@0505357913b0467408a205af8da75d10dd0a427b -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/jeremiah-k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@0505357913b0467408a205af8da75d10dd0a427b -
Trigger Event:
release
-
Statement type: