meaningless package

Web Extractor

class meaningless.bible_web_extractor.WebExtractor(translation='NIV', show_passage_numbers=True, output_as_list=False, strip_excess_whitespace_from_list=False, use_ascii_punctuation=False)

Bases: object

An extractor object that retrieves Bible passages from the Bible Gateway site.

This does NOT extend from the BaseExtractor class, as it would expose certain attributes and function parameters that don’t make sense for the Web Extractor and should not be interacted with (e.g. default directory, file path, file extension, etc.).

get_book(book)

Gets all chapters for a specific book from the Bible Gateway site.

Parameters:

book (str) – Name of the book (This must match the name used by the translation)

Returns:

All passages in the specified book. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapter(book, chapter)

Gets a single chapter from the Bible Gateway site.

The chapter parameter will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book (This must match the name used by the translation)

  • chapter (int) – Chapter number

Returns:

All passages in the chapter. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapters(book, chapter_from, chapter_to)

Gets a range of passages from a specified chapters selection from the Bible Gateway site.

The chapter parameters will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book (This must match the name used by the translation)

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

Returns:

All passages between the specified chapters (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passage(book, chapter, passage)

Gets a single passage from the Bible Gateway site.

The chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book.

Parameters:
  • book (str) – Name of the book (This must match the name used by the translation)

  • chapter (int) – Chapter number

  • passage (int) – Passage number

Returns:

The specified passage. Empty string/list if the passage is invalid.

Return type:

str or list

get_passage_range(book, chapter_from, passage_from, chapter_to, passage_to)

Gets a range of passages from one specific passage to another passage from the Bible Gateway site.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book.

Parameters:
  • book (str) – Name of the book (This must match the name used by the translation)

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passages(book, chapter, passage_from, passage_to)

Gets a range of passages of the same chapter from the Bible Gateway site.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book.

Parameters:
  • book (str) – Name of the book (This must match the name used by the translation)

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

Returns:

The passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

search(passage_name)

Retrieves a specific passage directly from the Bible Gateway site. The language used for the search text is independent of the translation. Note that the output is subject to the Bible Gateway implicit passage limit when sending the web request.

Parameters:

passage_name (str) – Name of the Bible passage which is valid when used on www.biblegateway.com

Returns:

Bible passage with preserved line breaks

Return type:

str or list

search_multiple(passage_names)

Retrieves a set of passages directly from the Bible Gateway site. Passages can be from different books. The language used for the search text is independent of the translation. Note that the output is subject to the Bible Gateway implicit passage limit when sending the web request.

Parameters:

passage_names (list) – List of Bible passages that are valid when used on www.biblegateway.com

Returns:

Bible passages with newline separators for each set of passages

Return type:

str or list

YAML Downloader

class meaningless.bible_yaml_downloader.YAMLDownloader(translation='NIV', show_passage_numbers=True, default_directory=os.getcwd(), strip_excess_whitespace=False, enable_multiprocessing=True, use_ascii_punctuation=False)

Bases: BaseDownloader

A downloader object that stores Bible passages into a local YAML file

download_book(book, file_path='')

Downloads a specific book of the Bible and saves it as a file

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapter(book, chapter, file_path='')

Downloads a single chapter as a file.

The chapter parameter will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapters(book, chapter_from, chapter_to, file_path='')

Downloads a range of passages from a specified chapter selection as a file.

Chapter parameters will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage(book, chapter, passage, file_path='')

Downloads a single passage as a file.

The chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Downloads a range of passages from one specific passage to another passage as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passages(book, chapter, passage_from, passage_to, file_path='')

Downloads a range of passages of the same chapter as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

YAML Extractor

class meaningless.bible_yaml_extractor.YAMLExtractor(translation='NIV', show_passage_numbers=True, output_as_list=False, strip_excess_whitespace_from_list=False, default_directory=os.getcwd(), use_ascii_punctuation=False)

Bases: BaseExtractor

An base extractor object that retrieves Bible passages from a YAML file

find_text_in_book(search_text, book, file_path='', is_case_sensitive=False, is_regex=False)

Gets all passages for a specific book from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapter(search_text, book, chapter, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapters(search_text, book, chapter_from, chapter_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from a specified chapter selection from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passage(search_text, book, chapter, passage, file_path='', is_case_sensitive=False, is_regex=False)

Gets a single passage from a file, containing a certain string or matching a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, the passage will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

The specified passage. Empty string/list if the passage is invalid or the passage did not meet the search criteria.

Return type:

str or list

find_text_in_passage_range(search_text, book, chapter_from, passage_from, chapter_to, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passages(search_text, book, chapter, passage_from, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages of the same chapter from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

get_book(book, file_path='')

Gets all chapters for a specific book from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the specified book. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapter(book, chapter, file_path='')

Gets a single chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the chapter. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapters(book, chapter_from, chapter_to, file_path='')

Gets a range of passages from a specified chapter selection from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified chapters (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passage(book, chapter, passage, file_path='')

Gets a single passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The specified passage. Empty string/list if the passage is invalid.

Return type:

str or list

get_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Gets a range of passages from one specific passage to another passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passages(book, chapter, passage_from, passage_to, file_path='')

Gets a range of passages of the same chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

JSON Downloader

class meaningless.bible_json_downloader.JSONDownloader(translation='NIV', show_passage_numbers=True, default_directory=os.getcwd(), strip_excess_whitespace=False, enable_multiprocessing=True, use_ascii_punctuation=False)

Bases: BaseDownloader

An downloader object that stores Bible passages into a local JSON file

download_book(book, file_path='')

Downloads a specific book of the Bible and saves it as a file

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapter(book, chapter, file_path='')

Downloads a single chapter as a file.

The chapter parameter will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapters(book, chapter_from, chapter_to, file_path='')

Downloads a range of passages from a specified chapter selection as a file.

Chapter parameters will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage(book, chapter, passage, file_path='')

Downloads a single passage as a file.

The chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Downloads a range of passages from one specific passage to another passage as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passages(book, chapter, passage_from, passage_to, file_path='')

Downloads a range of passages of the same chapter as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

JSON Extractor

class meaningless.bible_json_extractor.JSONExtractor(translation='NIV', show_passage_numbers=True, output_as_list=False, strip_excess_whitespace_from_list=False, default_directory=os.getcwd(), use_ascii_punctuation=False)

Bases: BaseExtractor

An base extractor object that retrieves Bible passages from a JSON file

find_text_in_book(search_text, book, file_path='', is_case_sensitive=False, is_regex=False)

Gets all passages for a specific book from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapter(search_text, book, chapter, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapters(search_text, book, chapter_from, chapter_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from a specified chapter selection from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passage(search_text, book, chapter, passage, file_path='', is_case_sensitive=False, is_regex=False)

Gets a single passage from a file, containing a certain string or matching a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, the passage will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

The specified passage. Empty string/list if the passage is invalid or the passage did not meet the search criteria.

Return type:

str or list

find_text_in_passage_range(search_text, book, chapter_from, passage_from, chapter_to, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passages(search_text, book, chapter, passage_from, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages of the same chapter from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

get_book(book, file_path='')

Gets all chapters for a specific book from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the specified book. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapter(book, chapter, file_path='')

Gets a single chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the chapter. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapters(book, chapter_from, chapter_to, file_path='')

Gets a range of passages from a specified chapter selection from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified chapters (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passage(book, chapter, passage, file_path='')

Gets a single passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The specified passage. Empty string/list if the passage is invalid.

Return type:

str or list

get_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Gets a range of passages from one specific passage to another passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passages(book, chapter, passage_from, passage_to, file_path='')

Gets a range of passages of the same chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

XML Downloader

class meaningless.bible_xml_downloader.XMLDownloader(translation='NIV', show_passage_numbers=True, default_directory=os.getcwd(), strip_excess_whitespace=False, enable_multiprocessing=True, use_ascii_punctuation=False)

Bases: BaseDownloader

An downloader object that stores Bible passages into a local XML file

download_book(book, file_path='')

Downloads a specific book of the Bible and saves it as a file

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapter(book, chapter, file_path='')

Downloads a single chapter as a file.

The chapter parameter will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapters(book, chapter_from, chapter_to, file_path='')

Downloads a range of passages from a specified chapter selection as a file.

Chapter parameters will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage(book, chapter, passage, file_path='')

Downloads a single passage as a file.

The chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Downloads a range of passages from one specific passage to another passage as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passages(book, chapter, passage_from, passage_to, file_path='')

Downloads a range of passages of the same chapter as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

XML Extractor

class meaningless.bible_xml_extractor.XMLExtractor(translation='NIV', show_passage_numbers=True, output_as_list=False, strip_excess_whitespace_from_list=False, default_directory=os.getcwd(), use_ascii_punctuation=False)

Bases: BaseExtractor

An base extractor object that retrieves Bible passages from an XML file

find_text_in_book(search_text, book, file_path='', is_case_sensitive=False, is_regex=False)

Gets all passages for a specific book from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapter(search_text, book, chapter, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapters(search_text, book, chapter_from, chapter_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from a specified chapter selection from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passage(search_text, book, chapter, passage, file_path='', is_case_sensitive=False, is_regex=False)

Gets a single passage from a file, containing a certain string or matching a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, the passage will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

The specified passage. Empty string/list if the passage is invalid or the passage did not meet the search criteria.

Return type:

str or list

find_text_in_passage_range(search_text, book, chapter_from, passage_from, chapter_to, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passages(search_text, book, chapter, passage_from, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages of the same chapter from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

get_book(book, file_path='')

Gets all chapters for a specific book from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the specified book. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapter(book, chapter, file_path='')

Gets a single chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the chapter. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapters(book, chapter_from, chapter_to, file_path='')

Gets a range of passages from a specified chapter selection from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified chapters (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passage(book, chapter, passage, file_path='')

Gets a single passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The specified passage. Empty string/list if the passage is invalid.

Return type:

str or list

get_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Gets a range of passages from one specific passage to another passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passages(book, chapter, passage_from, passage_to, file_path='')

Gets a range of passages of the same chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

CSV Downloader

class meaningless.bible_csv_downloader.CSVDownloader(translation='NIV', show_passage_numbers=True, default_directory=os.getcwd(), strip_excess_whitespace=False, enable_multiprocessing=True, use_ascii_punctuation=False)

Bases: BaseDownloader

An downloader object that stores Bible passages into a local CSV file

download_book(book, file_path='')

Downloads a specific book of the Bible and saves it as a file

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapter(book, chapter, file_path='')

Downloads a single chapter as a file.

The chapter parameter will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_chapters(book, chapter_from, chapter_to, file_path='')

Downloads a range of passages from a specified chapter selection as a file.

Chapter parameters will be automatically adjusted to the chapter boundaries of the specified book.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage(book, chapter, passage, file_path='')

Downloads a single passage as a file.

The chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Downloads a range of passages from one specific passage to another passage as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

download_passages(book, chapter, passage_from, passage_to, file_path='')

Downloads a range of passages of the same chapter as a file.

Chapter and passage parameters will be automatically adjusted to the respective chapter and passage boundaries of the specified book, except in the case where passage_from is unreasonably high.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, saves the file to this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

1 if the download was successful. 0 if an error occurred.

Return type:

int

CSV Extractor

class meaningless.bible_csv_extractor.CSVExtractor(translation='NIV', show_passage_numbers=True, output_as_list=False, strip_excess_whitespace_from_list=False, default_directory=os.getcwd(), use_ascii_punctuation=False)

Bases: BaseExtractor

An base extractor object that retrieves Bible passages from a CSV file

find_text_in_book(search_text, book, file_path='', is_case_sensitive=False, is_regex=False)

Gets all passages for a specific book from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapter(search_text, book, chapter, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_chapters(search_text, book, chapter_from, chapter_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from a specified chapter selection from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passage(search_text, book, chapter, passage, file_path='', is_case_sensitive=False, is_regex=False)

Gets a single passage from a file, containing a certain string or matching a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, the passage will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

The specified passage. Empty string/list if the passage is invalid or the passage did not meet the search criteria.

Return type:

str or list

find_text_in_passage_range(search_text, book, chapter_from, passage_from, chapter_to, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages from one specific passage to another passage from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

find_text_in_passages(search_text, book, chapter, passage_from, passage_to, file_path='', is_case_sensitive=False, is_regex=False)

Gets a range of passages of the same chapter from a file, where each passage contains a certain string or matches a particular regular expression.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • search_text (str) – Search text

  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

  • is_case_sensitive (bool) – When True, passages will attempt to match against the search text or regular expression with case sensitivity. Defaults to False.

  • is_regex (bool) – When True, the search text will be interpreted as a regular expression. Defaults to False.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid or none of the passages met the search criteria.

Return type:

str or list

get_book(book, file_path='')

Gets all chapters for a specific book from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the specified book. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapter(book, chapter, file_path='')

Gets a single chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages in the chapter. Empty string/list if the passage is invalid.

Return type:

str or list

get_chapters(book, chapter_from, chapter_to, file_path='')

Gets a range of passages from a specified chapter selection from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • chapter_to (int) – Last chapter number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified chapters (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passage(book, chapter, passage, file_path='')

Gets a single passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage (int) – Passage number

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The specified passage. Empty string/list if the passage is invalid.

Return type:

str or list

get_passage_range(book, chapter_from, passage_from, chapter_to, passage_to, file_path='')

Gets a range of passages from one specific passage to another passage from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter_from (int) – First chapter number to get

  • passage_from (int) – First passage number to get in the first chapter

  • chapter_to (int) – Last chapter number to get

  • passage_to (int) – Last passage number to get in the last chapter

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

All passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list

get_passages(book, chapter, passage_from, passage_to, file_path='')

Gets a range of passages of the same chapter from a file.

Output will be automatically adjusted to the chapter and passage boundaries from the input file.

Parameters:
  • book (str) – Name of the book

  • chapter (int) – Chapter number

  • passage_from (int) – First passage number to get

  • passage_to (int) – Last passage number to get

  • file_path (str) – When specified, reads the file from this location with a custom filename and extension. Using this parameter will take priority over the default_directory class property. Defaults to the default_directory path with the book as the file name with a default extension.

Returns:

The passages between the specified passages (inclusive). Empty string/list if the passage is invalid.

Return type:

str or list