Skip to main content

Python and command-line utility for converting scripture references between formats.

Project description

Scripture Lookup

Scripture Lookup is a Python library and command-line tool for looking up scripture verses or chapters. It can also convert scripture references between formats and languages. The tool is built around data from Python Scripture Scraper.

Installation

  1. Install Python 3 and the Homebrew package manager (if you don’t already have them installed).
  2. Install icu4c via Homebrew:
brew install icu4c
  1. Install Scripture Lookup:
pip install scripturelookup

Command-line usage

Pattern:

scripturelookup [command] [input] [options]

Examples:

% scripturelookup get_content "john 3:16" --lang "en"
16 ¶ For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

% scripturelookup get_label "니파이전서 3:7" --lang "fr" --abbreviated
1 Né 3:7

% scripturelookup get_church_url "helaman 5:12"
https://www.churchofjesuschrist.org/study/scriptures/bofm/hel/5?id=p12&lang=eng#p12

% scripturelookup get_label "/scriptures/nt/1-jn/3.2-3" --lang "cmn-Hant"
約翰一書3:2-3

% scripturelookup get_church_url "/scriptures/ot" --lang "es"
https://www.churchofjesuschrist.org/study/scriptures/ot?lang=spa

Python usage

Examples:

from scripturelookup import lookup

lookup.get_content('john 3:16', lang = 'en')
# 16 ¶ For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

lookup.get_label('니파이전서 3:7', lang = 'fr', abbreviated = True)
# 1 Né 3:7

lookup.get_church_url('helaman 5:12')
# https://www.churchofjesuschrist.org/study/scriptures/bofm/hel/5?id=p12&lang=eng#p12

lookup.get_label('/scriptures/nt/1-jn/3.2-3', lang = 'cmn-Hant')
# 約翰一書3:2-3

lookup.get_church_url('/scriptures/ot', lang = 'es')
# https://www.churchofjesuschrist.org/study/scriptures/ot?lang=spa

Commands, inputs, and options

Commands

  • get_content – Get chapter or verse content.
  • get_label – Get a scripture reference label (i.e. "John 3:16").
  • get_church_uri – Get a Gospel Library URI (i.e. "/scriptures/bofm/hel/5.12").
  • get_church_url – Get a Gospel Library URL.
  • get_church_link – Get an HTML link to Gospel Library.
  • get_reference_objects – Get a list of references as objects.
  • get_reference_attributes – Get a list of references as dictionaries.
  • sort_references – Sort a list of references by label or in traditional book order.

Inputs

Any of the following input types are supported. You can also provide several inputs at once as a list (separated by semicolons or line-breaks).

Options

Several options are available. Some are only applicable to certain commands.

  • lang (optional) – Output language. BCP 47 language codes and Gospel Library language codes are supported. Default: 'en'.
  • separator (optional) – String separator between outputs when a list of references is requested. Default: '\n'.
  • sort_by (optional) – Method for sorting references. Default: 'none'. Supported values: 'none', 'traditional', or 'label'.
  • source (optional) – Content source. Default: 'python-scripture-scraper'. Supported values: 'python-scripture-scraper' or 'ChurchofJesusChrist.org'.
  • link_class (optional) – String for the “class” attribute on links. Default: None.
  • link_target (optional) – String for the “target” attribute on links. Default: None.
  • use_query_parameters (optional) – Whether query parameters should be used on URIs. Default: False.
  • skip_lang (optional) – Whether “lang” query parameters should be skipped on URLs. Default: False.
  • skip_fragment (optional) – Whether fragments should be skipped on URLs. Default: False.
  • skip_book_name (optional) – Whether book names should be skipped on labels. Default: False.
  • abbreviated (optional) – Whether book abbrevions should be used on labels. Default: False.
  • skip_cleanup (optional) – Whether cleanup of the input string should be skipped when parsing. Can be used to speed up parsing if the input string is guaranteed to have well-formed references. Default: False.
  • range_split_limit (optional) – Threshold where a range of sequential verses will be split into separate verse groups. Default: 1.

Acknowledgements

Python Scripture Scraper – tool for scraping scripture content and metadata from ChurchofJesusChrist.org. geezify-python – tool for converting numbers to and from Geez numerals.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scripturelookup-0.0.7.tar.gz (198.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scripturelookup-0.0.7-py3-none-any.whl (202.9 kB view details)

Uploaded Python 3

File details

Details for the file scripturelookup-0.0.7.tar.gz.

File metadata

  • Download URL: scripturelookup-0.0.7.tar.gz
  • Upload date:
  • Size: 198.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scripturelookup-0.0.7.tar.gz
Algorithm Hash digest
SHA256 811714661c33aedfe07b07ebd77669fc1f42f2c4efdfa835064404d002fbd8f2
MD5 d1da1ff769f9bb9757708fd799b4d19b
BLAKE2b-256 f990f5583f12e1294bdaf2796e48b999ffd039e755921a2f6e54f512dce7b254

See more details on using hashes here.

File details

Details for the file scripturelookup-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: scripturelookup-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 202.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scripturelookup-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 94af82209a773e8d1b6a9e427766896ee9ae101a6262b8d5894df2a46f494acd
MD5 8ce21066208e985cde8036f454b14104
BLAKE2b-256 22b25b2edbadf67c7f677c59bc8b02ff4d1ba2f04988e785c394bab1c53dc9a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page