avendesora / pythonbible

A python library for validating, parsing, normalizing scripture references and retrieving scripture texts (for open source and public domain versions)
https://docs.python.bible
MIT License
58 stars 11 forks source link

Can't get references for an entire book of the Bible #7

Closed avendesora closed 4 years ago

avendesora commented 4 years ago

I can't get the normalized references for an entire book of the bible. For example:

import pythonbible as bible
references = bible.get_references("Genesis")

Raises the following error:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\projects-git\python-bible\pythonbible\parser.py", line 23, in get_references
    references.extend(normalize_reference(match[0]))
  File "C:\projects-git\python-bible\pythonbible\parser.py", line 49, in normalize_reference
    sub_reference, book, start_chapter
  File "C:\projects-git\python-bible\pythonbible\parser.py", line 82, in _process_sub_reference
    start_chapter = int(min_chapter_and_verse[0].strip())
ValueError: invalid literal for int() with base 10: ''

I would expect it to return:

[(<Book.GENESIS: 1>, 1, 1, 50, 26)]