Read passages from the bible using curl or HTTPie! All output to the terminal colored using ANSI Escape Codes.
curl "bible.ricotta.dev/John:3:15-19?options=length=35,width=50"
curl "bible.ricotta.dev/?book=John&chapter=3&verse=15-19"
curl "bible.ricotta.dev/John/3/15-19?version=YLT&text_only=True"
-
Ensure Podman-compose is installed. docker-compose does also work, but has [security issues].
-
Copy the compose file from the repo
wget https://github.com/connorricotta/curl_bible/blob/main/compose.yaml
-
Copy .env.sample and rename to .env
wget https://github.com/connorricotta/curl_bible/blob/main/.env.sample && mv .env.sample .env
-
Run the configuration script to generate a random password for both the root and regular database users.
./install.sh
-
Start up the program.
- The Database might take ~15 seconds to become ready for queries.
docker-compose up -d
- The Database might take ~15 seconds to become ready for queries.
Show manual installation instructions
- Ensure Python3, pip, and pipenv are installed.
- Change directory into the python directory and create a pipenv environment.
cd python
pipenv shell
- Start up the backend server with this command (more options can be found here)
gunicorn --bind 0.0.0.0:10000 wsgi:app --log-level warning --error-logfile error.log --capture-output --log-config logging.conf
- Ensure that mariadb is installed and you are able to connect to it.
- Open up mariadb and enter the following commands
The words in {braces} should be replaced with different values
CREATE USER 'bibleman'@'localhost' IDENTIFIED BY '{newpassword}'
CREATE DATABASE IF NOT EXISTS bible;
GRANT ALL PRIVILEGES ON bible.* TO 'bibleman'@'localhost';
FLUSH PRIVILEGES;
exit;
- Import the SQL dump into the bible database.
sudo mysql -u root -p bible < {path to directory}/curl_bible/sql/bible-mysql.sql
- Modify python/.env to make sure MYSQL_PASSWORD and DB_PORT match your current configuration.
MYSQL_ROOT_USER=root
MYSQL_ROOT_PASSWORD={changeme123}
MYSQL_USER=bibleman
MYSQL_PASSWORD={changemealso}
MYSQL_DATABASE=bible
DB_HOST=bible_db
DB_PORT=3306
- Full Verse Query (/
Book
:Chapter
:Verse
)
curl bible.ricotta.dev/John:3:15-20
- Slash Query (/
Book
/Chapter
/Verse
)
curl bible.ricotta.dev/John/3/15-20
- Parameter Query (/?book=
Book
&chapter=Chapter
&verse=Verse
)
curl "bible.ricotta.dev?book=John&chapter=3&verse=15-20"
Query Types | Examples |
---|---|
Single Verse | curl bible.ricotta.dev/John:3:15 |
curl bible.ricotta.dev/John/3/15 |
|
curl "bible.ricotta.dev/?book=John&chapter=3&verse=15" |
|
Multiple Verses | curl bible.ricotta.dev/John:3:15-20 |
curl bible.ricotta.dev/John/3/15-20 |
|
curl "bible.ricotta.dev/?book=John&chapter=3&verse=15-20" |
|
Entire Chapters | curl bible.ricotta.dev/John:3 |
curl bible.ricotta.dev/John/3 |
|
curl "bible.ricotta.dev/?book=John&chapter=3" |
The length, width, and output color of the returned book can be controlled by appending options=
or o=
to the query. The full list of options are:
length
orl
:- Set the number of columns in the returned book.
- Default Value:
20
width
orw
:- The size of each row in the returned book.
- Default Value:
80
text_only
ort
:- Only return the text, not the book.
- Default Value:
False
color_text
orc
:- Include ANSI Escape Codes in the output.
- Default Value:
True
verse_number
orb
:- Display the associated verse numbers in superscript.
- Default value:
False
version
orv
:- Specify which translation of the bible to query from.
- Default Value
ASV
(American Standard Version)
curl "bible.ricotta.dev/John/3/15-20?options=length=25,color_text=False,version=ASV"
curl "bible.ricotta.dev/John/3/15-20?length=25&color_text=False&version=ASV"
curl "bible.ricotta.dev/John/3/15-20?l=&w=50&c=False&v=ASV"
curl bible.ricotta.dev/help
There are five translation/versions that can be queried by this program. These versions are taken from https://github.com/scrollmapper/bible_databases
- ASV (American Standard Version)
- BBE (Bible in Basic English)
- KJV (King James Version)
- WEB (World English Bible)
- YLT (Young's Literal Translation)
curl bible.ricotta.dev/John/3/15-20?version=ASV
curl "bible.ricotta.dev?book=John&chapter=3&version=ylt"
curl bible.ricotta.dev/versions