The Bible module

Bible

The Bible class is the the main class of the module and the one responsible to return the verses. It has the following methods:

  • matthew

  • mark

  • luke

  • john

class pytholic.bible.bible.Bible[source]

Contains the 4 gospels of the New Jerusalem Bible Edition

These gospels are represented by the following methods: matthew(), mark(), luke() and john(). They receive three arguments, the first one is for the chapter number, the second one for the verse number and an optional third argument can be passed, it represents a final verse, for example, Matthew 1, 1-5, that “5” would be represented by the final verse, the third argument.

>>> bible = Bible()
>>> print(bible.matthew(1, 1))
Roll of the genealogy of Jesus Christ, son of David, son of Abraham:
>>> print(bible.mark(1, 1, 2))
['1. The beginning of the gospel about Jesus Christ, the Son of God. ', '2. It is written in the prophet Isaiah: Look, I am going to send my messenger in front of you to prepare your way before you. ']

BibleBooks

The BibleBooks stores the verses and chapters.

class pytholic.bible._books.BibleBooks[source]

Contains the 4 gospels of the Bible

john(chapter: int, verse_start: int, verse_end: Optional[int] = None) Union[str, list][source]
Parameters
  • chapter (int) – The chapter number

  • verse_start (int) – The first verse

  • verse_end (int or None) – Alternatively, an end verse can be passed or let it as None to return only one verse

luke(chapter: int, verse_start: int, verse_end: Optional[int] = None) Union[str, list][source]
Parameters
  • chapter (int) – The chapter number

  • verse_start (int) – The first verse

  • verse_end (int or None) – Alternatively, an end verse can be passed or let it as None to return only one verse

mark(chapter: int, verse_start: int, verse_end: Optional[int] = None) Union[str, list][source]
Parameters
  • chapter (int) – The chapter number

  • verse_start (int) – The first verse

  • verse_end (int or None) – Alternatively, an end verse can be passed or let it as None to return only one verse

matthew(chapter: int, verse_start: int, verse_end: Optional[int] = None) Union[str, list][source]
Parameters
  • chapter (int) – The chapter number

  • verse_start (int) – The first verse

  • verse_end (int or None) – Alternatively, an end verse can be passed or let it as None to return only one verse

get_text

The get_text function, as its name suggests, is the responsible to get the texts

class pytholic.bible._books.get_text(chapter_list, chapter, verse_start, verse_end, maxc)[source]

Receives the parameters passed to the Bible class

Parameters
  • chapter_list (dict) – List that contains all chapters of each of the gospels

  • chapter (dict) – Dictionary that contains all verses of a specified chapter

  • verse_start (int) – It can be the verse or the start verse if an end verse is passed

  • verse_end (int) – The end verse if a start verse is passed

  • maxc (int) – The last chapter of a book, so we can prevent an empty list or string

Returns

The verse if only one verse is passed or a list of verses if a start verse and an end verse is passed

Return type

str or list[str]

Raises
  • ChapterAndVerseMustBeIntError – If either the chapter or the verse isn’t an int

  • ChapterDoesntExistError – If the chapter passed as a parameter isn’t in the chapter list

  • StartVerseGreaterThanEndOneError – If the start verse if greater than the end verse

  • VerseDoesntExistError – If the verse passed as a parameter isn’t in the verse dictionary

  • EndVerseEqualToStartOneError – If the end verse and the start verse have the same value