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

Error when getting Genesis 1 with one verse per paragraph #5

Closed avendesora closed 4 years ago

avendesora commented 4 years ago

The following code raises a ValueError:

import pythonbible as bible
parser = bible.get_parser()
references = bible.get_references("Genesis 1")
verse_ids = bible.convert_references_to_verse_ids(references)
passage = parser.get_scripture_passage_text(verse_ids)
passage2 = parser.get_scripture_passage_text(verse_ids, one_verse_per_paragraph=True)

This is the error I'm getting:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 84, in get_scripture_passage_text
    paragraphs = _get_paragraphs(self.tree, self.namespaces, verse_ids, **kwargs)
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 139, in _get_paragraphs
    tree, namespaces, verse_ids[current_verse_index:], **kwargs
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 132, in _get_paragraphs
    paragraph_element, verse_ids, current_verse_id, **kwargs
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 170, in _get_paragraph_from_element
    child_element, verse_ids, new_current_verse_id
  File "C:\projects-git\python-bible\pythonbible\bible\osis\parser.py", line 295, in _is_next_verse
    book_id, chapter, verse = child_element.get("osisID").split(".")
ValueError: too many values to unpack (expected 3)