scripturelookup


Namescripturelookup JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryPython and command-line utility for converting scripture references between formats.
upload_time2024-11-18 05:42:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Samuel Bradshaw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python command scripture bible book of mormon reference
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/samuelbradshaw/python-scripture-scraper).


## Installation

1. Install [Python 3](https://gist.github.com/samuelbradshaw/932d48ef1eff07e288e25e4355dbce5d) and the [Homebrew](https://brew.sh) package manager (if you don’t already have them installed).
2. Install icu4c via Homebrew:
```
brew install icu4c
```
3. 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).

- Chapter or verse references, in any supported language. Examples:
  - John 3:16
  - Enos 1:13, 15–18
  - Psalm 23
  - Gen. 1:3 (3–4)
  - D&C 20:23; 76:41
- Scripture publication or book names. Examples:
  - Old Testament
  - Book of Mormon
  - 1 Corinthians
  - Psalms
- Gospel Library URIs (starting with `/scriptures`). Examples:
  - /scriptures/ot/gen
  - /scriptures/nt/matt/1
  - /scriptures/nt/john/3.16
  - /scriptures/bofm/enos/1.13,15-18
  - /scriptures/pgp
- Gospel Library URLs (old or new). Examples:
  - https://www.churchofjesuschrist.org/study/scriptures/bofm/hel/5?id=p12&lang=eng#p12
  - https://www.churchofjesuschrist.org/study/scriptures/ot?lang=eng
  - http://lds.org/scriptures/bofm/1-ne/3.7?lang=eng
  - [gospellibrary://content/scriptures/nt/john/3.16?lang=eng#16](https://www.churchofjesuschrist.org/study/scriptures/nt/john/3?id=p16&lang=eng#p16)

### 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.


## Acknowledgements
[Python Scripture Scraper](https://github.com/samuelbradshaw/python-scripture-scraper) – tool for scraping scripture content and metadata from ChurchofJesusChrist.org.
[geezify-python](https://github.com/logicalperson0/geezify-python) – tool for converting numbers to and from Geez numerals.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "scripturelookup",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, command, scripture, bible, book of mormon, reference",
    "author": null,
    "author_email": "Samuel Bradshaw <samuel.h.bradshaw@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/af/ee/3252c0bf22698c6fb229d827b44281ec57f7488ddbd606db14da63986756/scripturelookup-0.0.4.tar.gz",
    "platform": null,
    "description": "# Scripture Lookup\n\nScripture 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](https://github.com/samuelbradshaw/python-scripture-scraper).\n\n\n## Installation\n\n1. Install [Python 3](https://gist.github.com/samuelbradshaw/932d48ef1eff07e288e25e4355dbce5d) and the [Homebrew](https://brew.sh) package manager (if you don\u2019t already have them installed).\n2. Install icu4c via Homebrew:\n```\nbrew install icu4c\n```\n3. Install Scripture Lookup:\n```\npip install scripturelookup\n```\n\n\n## Command-line usage\n\nPattern:\n```\nscripturelookup [command] [input] [options]\n```\n\nExamples:\n```\n% scripturelookup get_content \"john 3:16\" --lang \"en\"\n16 \u00b6 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.\n\n% scripturelookup get_label \"\ub2c8\ud30c\uc774\uc804\uc11c 3:7\" --lang \"fr\" --abbreviated\n1 N\u00e9 3:7\n\n% scripturelookup get_church_url \"helaman 5:12\"\nhttps://www.churchofjesuschrist.org/study/scriptures/bofm/hel/5?id=p12&lang=eng#p12\n\n% scripturelookup get_label \"/scriptures/nt/1-jn/3.2-3\" --lang \"cmn-Hant\"\n\u7d04\u7ff0\u4e00\u66f83\uff1a2-3\n\n% scripturelookup get_church_url \"/scriptures/ot\" --lang \"es\"\nhttps://www.churchofjesuschrist.org/study/scriptures/ot?lang=spa\n```\n\n\n## Python usage\n\nExamples:\n```\nfrom scripturelookup import lookup\n\nlookup.get_content('john 3:16', lang = 'en')\n# 16 \u00b6 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.\n\nlookup.get_label('\ub2c8\ud30c\uc774\uc804\uc11c 3:7', lang = 'fr', abbreviated = True)\n# 1 N\u00e9 3:7\n\nlookup.get_church_url('helaman 5:12')\n# https://www.churchofjesuschrist.org/study/scriptures/bofm/hel/5?id=p12&lang=eng#p12\n\nlookup.get_label('/scriptures/nt/1-jn/3.2-3', lang = 'cmn-Hant')\n# \u7d04\u7ff0\u4e00\u66f83\uff1a2-3\n\nlookup.get_church_url('/scriptures/ot', lang = 'es')\n# https://www.churchofjesuschrist.org/study/scriptures/ot?lang=spa\n```\n\n\n## Commands, inputs, and options\n\n### Commands\n\n- **get_content** \u2013 Get chapter or verse content.\n- **get_label** \u2013 Get a scripture reference label (i.e. \"John 3:16\").\n- **get_church_uri** \u2013 Get a Gospel Library URI (i.e. \"/scriptures/bofm/hel/5.12\").\n- **get_church_url** \u2013 Get a Gospel Library URL.\n- **get_church_link** \u2013 Get an HTML link to Gospel Library.\n- **get_reference_objects** \u2013 Get a list of references as objects.\n- **get_reference_attributes** \u2013 Get a list of references as dictionaries.\n- **sort_references** \u2013 Sort a list of references by label or in traditional book order.\n\n### Inputs\n\nAny of the following input types are supported. You can also provide several inputs at once as a list (separated by semicolons or line-breaks).\n\n- Chapter or verse references, in any supported language. Examples:\n  - John 3:16\n  - Enos 1:13, 15\u201318\n  - Psalm 23\n  - Gen. 1:3 (3\u20134)\n  - D&C 20:23; 76:41\n- Scripture publication or book names. Examples:\n  - Old Testament\n  - Book of Mormon\n  - 1 Corinthians\n  - Psalms\n- Gospel Library URIs (starting with `/scriptures`). Examples:\n  - /scriptures/ot/gen\n  - /scriptures/nt/matt/1\n  - /scriptures/nt/john/3.16\n  - /scriptures/bofm/enos/1.13,15-18\n  - /scriptures/pgp\n- Gospel Library URLs (old or new). Examples:\n  - https://www.churchofjesuschrist.org/study/scriptures/bofm/hel/5?id=p12&lang=eng#p12\n  - https://www.churchofjesuschrist.org/study/scriptures/ot?lang=eng\n  - http://lds.org/scriptures/bofm/1-ne/3.7?lang=eng\n  - [gospellibrary://content/scriptures/nt/john/3.16?lang=eng#16](https://www.churchofjesuschrist.org/study/scriptures/nt/john/3?id=p16&lang=eng#p16)\n\n### Options\n\nSeveral options are available. Some are only applicable to certain commands.\n\n- **lang** (optional) \u2013 Output language. BCP 47 language codes and Gospel Library language codes are supported. Default: 'en'.\n- **separator** (optional) \u2013 String separator between outputs when a list of references is requested. Default: '\\n'.\n- **sort_by** (optional) \u2013 Method for sorting references. Default: 'none'. Supported values: 'none', 'traditional', or 'label'.\n- **source** (optional) \u2013 Content source. Default: 'python-scripture-scraper'. Supported values: 'python-scripture-scraper' or 'ChurchofJesusChrist.org'.\n- **link_class** (optional) \u2013 String for the \u201cclass\u201d attribute on links. Default: None.\n- **link_target** (optional) \u2013 String for the \u201ctarget\u201d attribute on links. Default: None.\n- **use_query_parameters** (optional) \u2013 Whether query parameters should be used on URIs. Default: False.\n- **skip_lang** (optional) \u2013 Whether \u201clang\u201d query parameters should be skipped on URLs. Default: False.\n- **skip_fragment** (optional) \u2013 Whether fragments should be skipped on URLs. Default: False.\n- **skip_book_name** (optional) \u2013 Whether book names should be skipped on labels. Default: False.\n- **abbreviated** (optional) \u2013 Whether book abbrevions should be used on labels. Default: False.\n\n\n## Acknowledgements\n[Python Scripture Scraper](https://github.com/samuelbradshaw/python-scripture-scraper) \u2013 tool for scraping scripture content and metadata from ChurchofJesusChrist.org.\n[geezify-python](https://github.com/logicalperson0/geezify-python) \u2013 tool for converting numbers to and from Geez numerals.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Samuel Bradshaw  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Python and command-line utility for converting scripture references between formats.",
    "version": "0.0.4",
    "project_urls": {
        "Changelog": "https://github.com/samuelbradshaw/python-scripture-lookup/releases",
        "Issues": "https://github.com/samuelbradshaw/python-scripture-lookup/issues",
        "Repository": "https://github.com/samuelbradshaw/python-scripture-lookup"
    },
    "split_keywords": [
        "python",
        " command",
        " scripture",
        " bible",
        " book of mormon",
        " reference"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae3cdefa14a74ab65d018954a1e1923905d683d20b75a7e6a19a7c78b92d1fe3",
                "md5": "835157ea3eb569799a5c7938c63e18f0",
                "sha256": "e41c5eed5e90a795be8cfa1e1cd2a44dd32c601869c8d7c02ac21c12692407b3"
            },
            "downloads": -1,
            "filename": "scripturelookup-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "835157ea3eb569799a5c7938c63e18f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 198401,
            "upload_time": "2024-11-18T05:42:17",
            "upload_time_iso_8601": "2024-11-18T05:42:17.674175Z",
            "url": "https://files.pythonhosted.org/packages/ae/3c/defa14a74ab65d018954a1e1923905d683d20b75a7e6a19a7c78b92d1fe3/scripturelookup-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "afee3252c0bf22698c6fb229d827b44281ec57f7488ddbd606db14da63986756",
                "md5": "9da2e622298c9448cd1c741ca6886622",
                "sha256": "8e34f26496bc7f3aef1cfeb238efed98289169d842398b1c03621605e6f3b919"
            },
            "downloads": -1,
            "filename": "scripturelookup-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "9da2e622298c9448cd1c741ca6886622",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 194101,
            "upload_time": "2024-11-18T05:42:19",
            "upload_time_iso_8601": "2024-11-18T05:42:19.091067Z",
            "url": "https://files.pythonhosted.org/packages/af/ee/3252c0bf22698c6fb229d827b44281ec57f7488ddbd606db14da63986756/scripturelookup-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-18 05:42:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "samuelbradshaw",
    "github_project": "python-scripture-lookup",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "scripturelookup"
}
        
Elapsed time: 0.96719s