PHPackages                             rootxs/sudobible - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. rootxs/sudobible

ActiveLibrary[API Development](/categories/api)

rootxs/sudobible
================

Open source Bible API.

0.0.2(10y ago)14611MITPHPPHP &gt;=5.4

Since Jul 30Pushed 10y ago2 watchersCompare

[ Source](https://github.com/Root-XS/SudoBible)[ Packagist](https://packagist.org/packages/rootxs/sudobible)[ Docs](https://github.com/Root-XS/SudoBible)[ RSS](/packages/rootxs-sudobible/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (1)

SudoBible
=========

[](#sudobible)

Open source Bible API.

Installation &amp; Setup
------------------------

[](#installation--setup)

Instantiate SudoBible with your database credentials, and optional translation preference (default translation is the [World English Bible](http://ebible.org/), a modern, public-domain, English translation):

```
$oBible = new \RootXS\SudoBible([
	'db_host' => 'localhost',
	'db_user' => 'my_user',
	'db_pass' => 'my_super_secure_password',
	'db_name' => 'my_db',
	'translation' => 'ASV',
]);
```

Call the following method once when first setting up, then delete this code once your tables have been created:

```
$oBible->install();
```

Leaving this code in your application won't break anything. It will just cause your application to make several superfluous database queries each time it runs. Therefore, it is recommended to run this once and then remove it from your code.

Alternatively, you can manually run the queries found in the `queries` directory. Find the sub-directory for your database type (e.g., `mysql`) and first run the `create` scripts, in order. Then run the `insert` scripts.

Basic usage
-----------

[](#basic-usage)

Get a single verse:

```
$oPassage = $oBible->verse('John', 3, 16);
```

Get an entire chapter:

```
$oPassage = $oBible->chapter('John', 3);
```

Get a passage (supply beginning &amp; end verses):

```
$oPassage = $oBible->ref('John', 3, 16, 17); // John 3:16-17
$oPassage = $oBible->ref('Hebrews', 5, 11, 6, 2); // Hebrews 5:11-6:2
```

Get one or more verses based on a topic:

```
$aPassages = $oBible->topic('church'); // returns an array of all related passages
$oPassage = $oBible->topic('church', true); // returns a single, random related passage
```

The SudoBiblePassage Object
---------------------------

[](#the-sudobiblepassage-object)

`verse()`, `chapter()`, and `ref()` each return a `SudoBiblePassage` object which contains the requested passage and provides utilities for manipulating it.

### Printing the passage

[](#printing-the-passage)

The `SudoBiblePassage` object employs the `__toString()` magic method, allowing you to simply `echo` or `print` the object.

```
echo $oBible->verse('John', 3, 16);
```

*Output:*

> For God so loved the world, that he gave his one and only Son, that whoever believes in him should not perish, but have eternal life. (John 3:16)

### Styling the passage

[](#styling-the-passage)

The `SudoBiblePassage` object provides a few methods for styling the string output.

```
$oPassage = $oBible->ref('John', 3, 16, 17)
	->numberVerses() // adds verse numbers to the passage string
	->useHTML(); // adds some HTML styling to the passage string
echo $oPassage;
```

*Output:*

> 16 For God so loved the world, that he gave his one and only Son, that whoever believes in him should not perish, but have eternal life. 17 For God didn't send his Son into the world to judge the world, but that the world should be saved through him. *(John 3:16-17)*

All of the styling methods accept a boolean parameter, so you can switch the styling off if it was previously turned on:

```
$oPassage->numberVerses(false);
```

The boolean flag defaults to `true`, so if you just want to turn the feature "on," no parameter is necessary.

### Navigating the passage

[](#navigating-the-passage)

The `SudoBiblePassage` object also provides a mechanism for proceding beyond the chosen passage:

```
$oPassage = $oBible->verse('John', 3, 16);
for ($i=0; $inextVerse();
}
```

Deleting or refreshing the database
-----------------------------------

[](#deleting-or-refreshing-the-database)

To delete the `sudo_bible_*` tables, run this once in your PHP code:

```
$oBible->uninstall();
```

Or, you can manually run the scripts found in `queries/{DB_TYPE}/drop`.

To refresh the tables (after an update to the SudoBible repo, for example), you can run this in your PHP:

```
$oBible->reinstall();
```

This simply combines `uninstall()` with `install()`. You may also manually run the query scripts in `drop`, `create`, and `insert`, in that order.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3945d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3bae2b0ad6d1798fc157354c908fe870fcdc4c42aa37a51d2b875c36bbb5d066?d=identicon)[rootxs](/maintainers/rootxs)

---

Top Contributors

[![mopo922](https://avatars.githubusercontent.com/u/1744373?v=4)](https://github.com/mopo922 "mopo922 (1 commits)")

---

Tags

apibiblescriptureversetopic

### Embed Badge

![Health badge](/badges/rootxs-sudobible/health.svg)

```
[![Health](https://phpackages.com/badges/rootxs-sudobible/health.svg)](https://phpackages.com/packages/rootxs-sudobible)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
