Book Groups
#
What Are Book Groups?The books of the Bible can be categorized into different groups.
The first and biggest categorization is dividing the books into the Old Testament
(Genesis - Malachi) and the New Testament
(Matthew - Revelation).
Within the Old Testament, the books can be further divided as follows:
Law
(Genesis - Deuteronomy)History
(Joshua - Esther)Poetry/Wisdom
(Job - Song of Solomon)Prophecy
(Isaiah - Malachi)
The Prophecy books can be further divided into:
Major Prophets
(Isaiah - Daniel)Minor Prophets
(Hosea - Malachi)
Within the New Testament, the books can be divided as follows:
Gospel
(Matthew - John)History
(Acts)Epistles
(Romans - Jude)Apocalyptic
(Revelation)
The Epistles can be further divided into:
Pauline Epistles
(Romans - Philemon)General Epistles
(Hebrews - Jude)
#
Finding References by Book GroupsBy default, when pythonbible parses text to find all references contained within, it does not take book groups into consideration.
For example:
#
Finding References by Default Book GroupsWhen parsing text to find all references contained within, you can pass in an optional book_groups
parameter telling pythonbible what book groups to take into consideration.
The pythonbible library includes a book_groups
value for you to use that includes all the book groups described above. To use that, pass bible.BOOK_GROUPS
as the value for the optional book_groups
argument.
For example:
When formatting the resulting reference for print/display, the reference text will use the books (and chapters and verses, if needed) rather than the book group.
For example:
If you want to include the chapter and verse numbers, set the optional always_include_chapter_numbers
argument to True
for the format_scripture_references
(or format_single_reference
) function.
#
Finding References by Custom Book GroupsIf you don't want to use the book groups as defined above but rather a subset of them or additional categorizations or completely custom categorizations, you can do that by passing in a custom value for the book_groups
optional argument of the get_references
function.
The expected type of the book_groups
argument is a Dict[str, List[Book]]
where the string key is a regular expression to be used to match to that particular book group, and the list of Book objects are the books of the Bible associated with that book group.
There is a BookGroup
Enum included to help with this.
For example, if you wanted to only use the Old Testament
and New Testament
book groups, the following example using the default book groups would return too many references.
Instead, you will need to define a custom book_groups
value containing only the Old and New Testament information.
With the custom subset book groups definition, only the Old Testament reference is included in the results and not the Gospels reference.
You can also define your own completely custom book groups definition. For example: