Giter Club home page Giter Club logo

bible_search's Introduction

bible_search

A Python package for searching multiple versions of the Bible.

Installation

pip install multi_bible_search

Usage

from multi_bible_search import BibleSearch


if __name__ == '__main__':
    searcher = BibleSearch()
    query_results = searcher.search("Jesus wept")
    print(query_results[0:10])

The search method returns a list of references. For example, the above code prints the following:

['Luke 8:52', 'Matthew 1:16', 'Luke 5:31', '1 Corinthians 2:2', 'Colossians 1:1', 'Matthew 22:41', 'Genesis 37:35', 'Luke 2:21', 'John 8:59', 'Matthew 3:16']

The results of each query are ranked by the number of keyword occurrences.

If a query is made with no matches, say "notawordinthebible," the result of the query will be a list of length 0.

The maximum number of results may be specified with the optional max_results parameter.

Preloading an Index

Versions are automatically loaded as needed, but you may wish to preload a version for the sake of speed.

An index of a particular version can be preloaded with the load() method. Simply pass the version identifier as a string to load it.

Remember that capitalization is important when using this method.

You may also preload all versions by simply calling the load_all() method.

Finally, you can unload a version with the unload_version() method for a particular version.

Supported Versions

Supported versions can be listed with

BibleSearch().versions

Currently, these versions are supported:

  • A Conservative Version (ACV)

  • American King James Version (AKJV)

  • Amplified Bible (AMP)

  • American Standard Version (ASV)

  • Bible in Basic English (BBE)

  • Berean Standard Bible (BSB)

  • Christian Standard Bible (CSB)

  • Darby Bible (Darby)

  • Douay-Rheims 1899 American Edition (DRA)

  • Rotherham's Emphasized Bible (EBR)

  • English Standard Version (ESV)

  • Geneva Bible (GNV)

  • King James Version 1769 (KJV)

  • King James Version 1611 (KJV 1611)

  • Literal Standard Version (LSV)

  • The Message (MSG)

  • New American Standard Bible (NASB 1995)

  • New English Translation (NET)

  • New International Version (NIV 1984)

  • New International Version (NIV 2011)

  • New King James Version (NKJV)

  • New Living Translation (NLT)

  • Restored Name King James Version (RNKJV)

  • Revised Standard Version (RSV)

  • Revised Webster Version 1833 (RWV)

  • Updated King James Version (UKJV)

  • World English Bible (WEB)

  • Young’s Literal Translation (YLT)

Versions can be specified with the version parameter in search(). The string passed should be the short form of the version name.

For example, you could use:

BibleSearch().search("Jesus wept", version="ESV")

to search the ESV.

bible_search's People

Contributors

samhaswon avatar

Stargazers

Ron Hudson avatar

Watchers

Ron Hudson avatar  avatar

bible_search's Issues

This is cool!

Hey this looks awesome I'll probably add this to my keybase bot.

Installation fails, import fails

Installation issue. I'm trying to use your multi_bible_search package and get errors during the installation and in Visual Studio Code the import fails for multi_bible_search.
I have the following versions:
Python 3.12.3
pip 24.0
Name: wheel Version: 0.43.0
Name: setuptools Version: 69.5.1

I've tried installing using these two ways but get the same results.
From the python directory ..\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip
I've tried running both of these commands:
py -m pip install "C:\Python libraries\multi_bible_search-1.0.0"
pip install multi_bible_search

I get:
C:\Users\shawn\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip>pip install multi_bible_search
Collecting multi_bible_search
Downloading multi_bible_search-1.0.0.tar.gz (27.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 27.2/27.2 MB 14.5 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: multi_bible_search
Building wheel for multi_bible_search (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for multi_bible_search (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [94 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-312
creating build\lib.win-amd64-cpython-312\ctranslate
copying src\ctranslate_init_.py -> build\lib.win-amd64-cpython-312\ctranslate
creating build\lib.win-amd64-cpython-312\multi_bible_search
copying src\multi_bible_search\bible_search.py -> build\lib.win-amd64-cpython-312\multi_bible_search
copying src\multi_bible_search\translate.py -> build\lib.win-amd64-cpython-312\multi_bible_search
copying src\multi_bible_search_init_.py -> build\lib.win-amd64-cpython-312\multi_bible_search
running egg_info
writing src\multi_bible_search.egg-info\PKG-INFO
writing dependency_links to src\multi_bible_search.egg-info\dependency_links.txt
writing top-level names to src\multi_bible_search.egg-info\top_level.txt
reading manifest file 'src\multi_bible_search.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'src\multi_bible_search.egg-info\SOURCES.txt'
C:\Users\shawn\AppData\Local\Temp\pip-build-env-vshcwxb4\overlay\Lib\site-packages\setuptools\command\build_py.py:207: _Warning: Package 'multi_bible_search.data' is absent from the packages configuration.
!!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'multi_bible_search.data' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'multi_bible_search.data' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'multi_bible_search.data' to be distributed and are
          already explicitly excluding 'multi_bible_search.data' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  copying src\ctranslate\ctranslate.c -> build\lib.win-amd64-cpython-312\ctranslate
  creating build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\ACV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\AKJV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\AMP.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\ASV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\All.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\BBE.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\BSB.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\CSB.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\DRA.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\Darby.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\EBR.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\ESV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\GNV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\KJV 1611.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\KJV-like.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\KJV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\LSV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\MSG.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\NASB 1995.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\NET.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\NIV 1984.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\NIV 2011.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\NKJV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\NLT.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\RNKJV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\RSV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\RWV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\UKJV.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\WEB.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  copying src\multi_bible_search\data\YLT.json.pbz2 -> build\lib.win-amd64-cpython-312\multi_bible_search\data
  running build_ext
  building 'ctranslate.ctranslate' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for multi_bible_search
Failed to build multi_bible_search
ERROR: Could not build wheels for multi_bible_search, which is required to install pyproject.toml-based projects

C:\Users\shawn\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.