BibleStudent.KJV.Bible
2.0.0
dotnet add package BibleStudent.KJV.Bible --version 2.0.0
NuGet\Install-Package BibleStudent.KJV.Bible -Version 2.0.0
<PackageReference Include="BibleStudent.KJV.Bible" Version="2.0.0" />
<PackageVersion Include="BibleStudent.KJV.Bible" Version="2.0.0" />
<PackageReference Include="BibleStudent.KJV.Bible" />
paket add BibleStudent.KJV.Bible --version 2.0.0
#r "nuget: BibleStudent.KJV.Bible, 2.0.0"
#:package BibleStudent.KJV.Bible@2.0.0
#addin nuget:?package=BibleStudent.KJV.Bible&version=2.0.0
#tool nuget:?package=BibleStudent.KJV.Bible&version=2.0.0
BibleStudent.KJV.Bible
Complete King James Version Bible library for .NET.
All 66 books · 1,189 chapters · 31,102 verses — embedded offline, no network required.
Installation
dotnet add package BibleStudent.KJV.Bible
Quick start
using BibleStudent.KJV;
var bible = new Bible();
// Verse of the day (deterministic per date)
BibleVerse votd = bible.GetVerseOfTheDay();
Console.WriteLine(votd); // John 3:16 For God so loved…
// Read a chapter
BibleChapter? ch = bible.GetChapter("John", 3);
Console.WriteLine(ch!.ToFormattedText());
// Search
var results = bible.Search("God so loved", new SearchOptions { MaxResults = 10 });
foreach (var v in results)
Console.WriteLine($"{v.Reference}: {v.Text}");
Namespace
using BibleStudent.KJV;
All public types live in the BibleStudent.KJV namespace.
API Reference
Bible — main class
| Method | Description |
|---|---|
GetVerseOfTheDay() |
Today's verse; deterministic (same date → same verse) |
GetVerseOfTheDay(DateOnly) |
Verse of the day for any date |
GetRandomVerse() |
Uniformly-random verse from the whole Bible |
GetRandomVerseFromBook(string) |
Random verse from a specific book |
GetChapter(string, int) |
Returns BibleChapter? by book name/abbr and chapter number |
GetNextChapter(string abbr, int) |
Next chapter, crossing book boundaries |
GetPreviousChapter(string abbr, int) |
Previous chapter, crossing book boundaries |
GetBook(string) |
BibleBook? by full name or abbreviation |
GetVerseByIndex(int) |
BibleVerse? by 0-based sequential index (0–31101) |
GetVerses(string, int, int, int) |
Verse range within one chapter |
GetContext(BibleVerse, int radius) |
Source verse ± radius neighbours |
TryLookup(string, out IReadOnlyList<BibleVerse>?) |
Parse a reference string |
Search(string, SearchOptions?) |
Full-text search (all words must appear) |
SearchAny(IEnumerable<string>, SearchOptions?) |
Full-text search (OR logic) |
GetStats() |
Aggregate statistics (BibleStats) |
Properties:
| Property | Type | Description |
|---|---|---|
Books |
IReadOnlyList<BibleBook> |
All 66 books, canonical order |
OldTestament |
IReadOnlyList<BibleBook> |
39 OT books |
NewTestament |
IReadOnlyList<BibleBook> |
27 NT books |
BibleVerse
record BibleVerse
{
string BookName // "Genesis", "1 Corinthians", …
string BookAbbreviation // "Gen", "1Cor", …
int Chapter // 1-based
int Verse // 1-based
string Text // KJV verse text
string Reference // "John 3:16" (computed)
int GlobalIndex // 0-based sequential index across all 31,102 verses
}
BibleBook
record BibleBook
{
string Name // "Psalms"
string Abbreviation // "Ps"
int ChapterCount // number of chapters
int VerseCount // total verses across all chapters
Testament Testament // Testament.Old / Testament.New
int BookNumber // 1-based canonical position
}
BibleChapter
record BibleChapter
{
string BookName
string BookAbbreviation
int ChapterNumber
IReadOnlyList<BibleVerse> Verses
int VerseCount // computed
string ToFormattedText() // "John 3\n\n[1] In the beginning…"
}
SearchOptions
All properties are init-only — use an object initialiser:
var opts = new SearchOptions
{
CaseSensitive = false, // default false
WholeWord = false, // default false
MaxResults = 200, // default 200; 0 = unlimited
TestamentFilter = Testament.New, // default null (both)
BookFilter = "Romans", // default null (all books)
};
BibleStats
record BibleStats
{
int TotalBooks
int TotalChapters
int TotalVerses
int TotalWordCount
string LongestBook
string ShortestBook
}
Extension methods (BibleExtensions)
WordFrequency
IReadOnlyList<(string Word, int Count)> WordFrequency(
this IEnumerable<BibleVerse> verses,
bool caseSensitive = false)
Returns word-frequency pairs, sorted by count descending:
var top20 = bible.Search("love")
.WordFrequency(caseSensitive: false)
.Take(20);
foreach (var (word, count) in top20)
Console.WriteLine($"{word}: {count}");
Book names and abbreviations
Books can be identified by their full name or any of these abbreviations:
| # | Book | Abbreviation | Also accepted | |---|------|-------------|---------------| | 1 | Genesis | Gen | Ge, Gn | | 19 | Psalms | Ps | Psa, Psalm | | 22 | Song of Solomon | Song | SoS, SS, Cant | | 43 | John | John | Jn, Joh | | 46 | 1 Corinthians | 1Cor | 1 Cor, 1Co, I Cor | | 66 | Revelation | Rev | Re, Rv, Apoc | (all 66 books supported — see source for full alias list)
Bible text
The King James Version (KJV) is in the public domain. The text included in this package is sourced from the public domain dataset at github.com/aruljohn/Bible-kjv.
License
MIT — see LICENSE
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|
2nd Major Update
- Refactored code
- Renamed funtions