{ "info": { "author": "David Davis", "author_email": "davisd@davisd.com", "bugtrack_url": null, "classifiers": [], "description": "=================\nPython Scriptures\n=================\n\npython-scriptures is a Python 2 and Python 3 compatible package and regular\nexpression library for validating, extracting and normalizing biblical\nscripture references from blocks of text.\n\nFor more information, see http://www.davisd.com/projects/python-scriptures/\n\nTypical usage is as follows::\n\n #!/usr/bin/env python\n\n >>> import scriptures\n >>> scriptures.extract('This is a test Rom 3:23-28 and 1 JOHn 2')\n [('Romans', 3, 23, 3, 28), ('I John', 2, 1, 2, 29)]\n\nRange validation is performed automatically and invalid references are not\nextracted.\n\n >>> import scriptures\n >>> scriptures.extract('Romans 3:23 is real, but Romans 2:30 is invalid.')\n [('Romans', 3, 23, 3, 23)]\n\nMulti-Chapter references work:\n\n >>> import scriptures\n >>> scriptures.extract('You can specify a range of chapters like Rev 2-3')\n [('Revelation of Jesus Christ', 2, 1, 3, 22)]\n \nReferences with single chapter books do not require the chapter be specified.\n\n >>> import scriptures\n >>> scriptures.extract('You can specify a single verse such as Jude 4')\n [('Jude', 1, 4, 1, 4)]\n >>> scriptures.extract('Or specify multiple verses with jude 2-5...')\n [('Jude', 1, 2, 1, 5)]\n\n\nInstallation\n============\n\nA setup script (setup.py) is provided. To install, simply run the script with\nthe install command:\n\n$ python setup.py install\n\nOr just put the scriptures package somewhere on the Python path.\n\n\nAPI\n===\n\nReturn Values\n-------------\n\nWhen a \"scripture reference\" is returned, it is always a five value tuple\nconsisting of:\n\n('Book name', start chapter, start verse, end chapter, end verse)\n\n\nFunctions\n---------\n\nThere are four public functions exposed by this package.\n\nextract\n~~~~~~~\n\nExtract a list of tupled scripture references from a block of text.\n\nArguments:\n\n text -- the block of text containing potential scripture references\n\nExample:\n\n >>> import scriptures\n >>> scriptures.extract('This is a test Rom 3:23-28 and 1 JOHn 2')\n [('Romans', 3, 23, 3, 28), ('I John', 2, 1, 2, 29)]\n\n\nreference_to_string\n~~~~~~~~~~~~~~~~~~~\n\nGet a display friendly string from a scripture reference.\n\nArguments:\n\n bookname -- the full or abbreviated book name\n\n chapter -- the starting chapter\n\nOptional Arguments:\n\n verse -- the starting verse\n\n end_chapter -- the ending chapter\n\n end_verse -- the ending verse\n\nExamples:\n\n >>> import scriptures\n >>> scriptures.reference_to_string('acts', 1)\n 'Acts 1'\n >>> scriptures.reference_to_string('John', 3, 16)\n 'John 3:16'\n >>> scriptures.reference_to_string('Rom', 3, 23, 3, 28)\n 'Romans 3:23-28'\n >>> scriptures.reference_to_string('ecc', 1, 2, 2)\n 'Ecclesiastes 1:2-2:26'\n >>> scriptures.reference_to_string('john', 1, 1, 2, 25)\n 'John 1-2'\n\nSingle Chapter Book Examples:\n\n >>> import scriptures\n >>> scriptures.reference_to_string('jude', 1, 4)\n 'Jude 4'\n >>> scriptures.reference_to_string('2john', 1, 4, 1, 7)\n 'II John 4-7'\n\n\nnormalize_reference\n~~~~~~~~~~~~~~~~~~~\n\nGet a complete five value tuple scripture reference with full book name from\npartial data.\n\nArguments:\n\n bookname -- the full or abbreviated book name\n\n chapter -- the starting chapter\n\nOptional Arguments:\n\n verse -- the starting verse\n\n end_chapter -- the ending chapter\n\n end_verse -- the ending verse\n\nExamples:\n\n >>> import scriptures\n >>> scriptures.normalize_reference('acts', 1)\n ('Acts', 1, 1, 1, 26)\n >>> scriptures.normalize_reference('John', 3, 16)\n ('John', 3, 16, 3, 16)\n >>> scriptures.normalize_reference('Rom', 3, 23, 3, 28)\n ('Romans', 3, 23, 3, 28)\n >>> scriptures.normalize_reference('ecc', 1, 2, 2)\n ('Ecclesiastes', 1, 2, 2, 26)\n\n\nis_valid_reference\n~~~~~~~~~~~~~~~~~~\n\nCheck to see if a scripture reference is valid.\n\nArguments:\n\n bookname -- the full or abbreviated book name\n\n chapter -- the starting chapter\n\nOptional Arguments:\n\n verse -- the starting verse\n\n end_chapter -- the ending chapter\n\n end_verse -- the ending verse\n\nExamples:\n\n >>> import scriptures\n >>> scriptures.is_valid_reference('John', 3, 16)\n True\n >>> scriptures.is_valid_reference('ecc', 1, 2, 2)\n True\n >>> scriptures.is_valid_reference('Romans', 2, 30)\n False\n >>> scriptures.is_valid_reference('Romans', 2, 20, 2, 29)\n True\n\n\nRegular Expressions\n-------------------\n\nThere are two compiled regular expression patterns exposed by this package.\n\nbook_re\n~~~~~~~\n\nMatch a valid abbreviation or book name.\n\nExamples:\n\n >>> import scriptures\n >>> import re\n >>> re.findall(scriptures.book_re, 'Matt test Ecclesiastes and 2 peter')\n ['Matt', 'Ecclesiastes', '2 peter'] \n\n\nscripture_re\n~~~~~~~~~~~~\n\nMatch a scripture reference pattern from a valid abbreviation or book name.\n\nExamples:\n\n >>> import scriptures\n >>> import re\n >>> re.findall(scriptures.scripture_re, 'Matt 3 & Acts 1:2-3 Rev 2:1-3:2')\n [('Matt', '3', '', '', ''), ('Acts', '1', '2', '', '3'),\n ('Rev', '2', '1', '3', '2')]\n\n\nUnicode\n=======\n\nThis library is unicode compatible and recognizes the \\u2013 en dash and \\u2014\nem dash.\n\n\nAdditional Texts\n================\n\nThis library currently provides the following texts:\n\n* protestant - scriptures.texts.protestant.ProtestantCanon\n* deuterocanon - scriptures.texts.deutercanon.Deuterocanon\n* kjv1611 - scriptures.texts.kjv1611.KingJames1611\n\nUsage\n-----\n\nTo use the additional texts, simply instantiate the text object and use the api\nfunctions and regular expressions on the new instance.\n\nExample\n~~~~~~~\n\n >>> from scriptures.texts.kjv1611 import KingJames1611\n >>> myKJV1611 = KingJames1611()\n >>> myKJV1611.extract('the protestant books are implemented- Matthew 1:1-5')\n [(u'Matthew', 1, 1, 1, 5)]\n >>> myKJV1611.extract('and Deuterocanon (apocrypha)- wisdom of solomon 1:1')\n [(u'The Wisdom of Solomon', 1, 1, 1, 1)]\n >>> myKJV1611.extract('and I Esd 1:1, II Esd 1:1, Prayer of Manasseh 1:1')\n [(u'I Esdras', 1, 1, 1, 1), (u'II Esdras', 1, 1, 1, 1), (u'Prayer of Manasseh', 1, 1, 1, 1)]\n\n\nCustom Texts\n============\n\nAs of v3.0.0, the library makes makes extending the library through custom texts\ntrivial through additional modules. Please consider contributing your text\nmodules to this project by creating texts under scriptures/texts/ and submitting\na pull request.\n\n\nCreating a New Text\n-------------------\n\nTo create a new Text,\n\n1) Create a class that inherits from scriptures.base.Text\n2) Implement the \"books\" dictionary\n3) Instantiate your new text and use it\n\nThe four api functions will be available from your instance:\n\n* extract\n* reference_to_string\n* normalize_reference\n* is_valid_reference\n\nThe two regular expressions are also available:\n\n* book_re\n* scripture_re\n\n\nExample\n~~~~~~~\n\n >>> from scriptures.texts.base import Text\n >>> class MyText(Text):\n >>> books = {\n >>> 'test1': ('Test Book 1', 'TBook1', 'test(?:\\s)?1', [5, 4, 3, 4, 5]),\n >>> 'test2': ('Test Book 2', 'TBook2', 'test(?:\\s)?2', [5, 4, 3, 4, 5])\n >>> }\n >>>\n >>> mytext = MyText()\n >>> mytext.extract('Ok, testing- test1 1:3-5 and test2 2:4')\n [('Test Book 1', 1, 3, 1, 5), ('Test Book 2', 2, 4, 2, 4)]\n\n\nCreating a New Text Using Another As a Starting Point\n-----------------------------------------------------\n\nIf you would like to use an existing set of books as a starting point, simply\nupdate your books dictionary using the books from the Text class (or classes)\nthat you'd like to use as a starting point.\n\nFor an example of this, see the \"KingJames1611\" text class in \nscriptures/text/kjv1611.py\n\nThe KingJames1611 Text class uses the ProtestantCanon and Deuterocanon books as\na starting point and adds I Esdras, II Esdras, and the Prayer of Manasseh.\n\nTest Suite\n==========\n\nUnit tests are provided to verify chapter and verse style normalization, output\nformatting, and book names and abbreviations.\n\nTo run the test suite, cwd to just outside of the scriptures package and:\n\n$ python -m unittest discover\n\n\nAuthor\n======\n\nDavid Davis \nhttp://www.davisd.com\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.davisd.com/projects/python-scriptures/", "keywords": "", "license": "LICENSE", "maintainer": "", "maintainer_email": "", "name": "python-scriptures", "package_url": "https://pypi.org/project/python-scriptures/", "platform": "", "project_url": "https://pypi.org/project/python-scriptures/", "project_urls": { "Homepage": "http://www.davisd.com/projects/python-scriptures/" }, "release_url": "https://pypi.org/project/python-scriptures/3.0.0/", "requires_dist": null, "requires_python": "", "summary": "python-scriptures is a Python package and regular expression library for validating, extracting, and normalizing biblical scripture references from blocks of text.", "version": "3.0.0" }, "last_serial": 2544893, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e38bb6dbd0242f38eabd268289547174", "sha256": "0a4f2cb4fcefc6c9e7572c224e671aecb756769f3a83a10a747870ba404b248e" }, "downloads": -1, "filename": "python-scriptures-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e38bb6dbd0242f38eabd268289547174", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6856, "upload_time": "2011-11-24T18:38:51", "url": "https://files.pythonhosted.org/packages/03/e9/44727d09162f915ad997a60c71dcb4b475103b8b1939ac0c942728ce4781/python-scriptures-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f681c3232f1d2c061086b09e4bd97ecf", "sha256": "48dd1128282cd3a15248cf0e1ef29a53a998b826e3cb68bb14948d2c68336464" }, "downloads": -1, "filename": "python-scriptures-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f681c3232f1d2c061086b09e4bd97ecf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6905, "upload_time": "2011-11-25T16:31:17", "url": "https://files.pythonhosted.org/packages/c0/ed/53ec78a17365b347623da4891e2408f1e0e9103d870a62689eaa0d94116b/python-scriptures-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "db7c0e6b12821b7f5193c2f26a1d3033", "sha256": "ffc2c513035cad0a9f75e45fa326cef8555bf0c473b4765723e741524cef9f9f" }, "downloads": -1, "filename": "python-scriptures-1.1.0.tar.gz", "has_sig": false, "md5_digest": "db7c0e6b12821b7f5193c2f26a1d3033", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7349, "upload_time": "2012-03-31T18:52:16", "url": "https://files.pythonhosted.org/packages/68/8a/70ce0143a3eb0fda129e70e0d01359c320216b1f28308a0084a9f11eaf70/python-scriptures-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "f38f5a7a987822c26098f82cb6def459", "sha256": "1bed4bacf0dd3ba604b40f5b1b0ea1198e2ba118c322cff4cbeadf8a74dd048f" }, "downloads": -1, "filename": "python-scriptures-1.1.1.tar.gz", "has_sig": false, "md5_digest": "f38f5a7a987822c26098f82cb6def459", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7431, "upload_time": "2013-04-01T21:53:04", "url": "https://files.pythonhosted.org/packages/89/e9/add2fd7c8d79f4845db89864d82b4a2e4f1aa068b8185cf978bb7bcd728d/python-scriptures-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "0519613e45c996c4b63ed29f4639f310", "sha256": "c74e636cbc87619f789e4eb279fc0c5457fe46116337d4fa16d6021eefe25fda" }, "downloads": -1, "filename": "python-scriptures-1.1.2.tar.gz", "has_sig": false, "md5_digest": "0519613e45c996c4b63ed29f4639f310", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7434, "upload_time": "2013-05-03T12:20:02", "url": "https://files.pythonhosted.org/packages/e9/b0/787ea59e96668237edf8e6416e77559df5b71e7c29952ffdd37fc5f8261b/python-scriptures-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "a1c027c158ee8fcd2e02e46dbca4bb87", "sha256": "46d7b550cdbc9b57eaa33869a14827bb23f366e9263ca2e40aab7d484f7c99d8" }, "downloads": -1, "filename": "python-scriptures-1.1.3.tar.gz", "has_sig": false, "md5_digest": "a1c027c158ee8fcd2e02e46dbca4bb87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7356, "upload_time": "2014-04-05T13:10:34", "url": "https://files.pythonhosted.org/packages/9e/49/0731e131a0f1cf881bae7a0b5f2d72ebe6fcd42349ca9661a9bb8d463073/python-scriptures-1.1.3.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "51ae1ff12cb43b6b96640a225c4cab39", "sha256": "af684d4b823ffe680f3be384a433b1227f44a2428e862f6212f96f2653dbe2f9" }, "downloads": -1, "filename": "python-scriptures-2.0.0.tar.gz", "has_sig": false, "md5_digest": "51ae1ff12cb43b6b96640a225c4cab39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7370, "upload_time": "2014-04-05T13:44:20", "url": "https://files.pythonhosted.org/packages/a7/f4/23450e796e4312935d25e5beafb66346ff79f1e583e644fdf9258bebda62/python-scriptures-2.0.0.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "766f762001091b133a2c2994dcc96ed3", "sha256": "96a5e8b55c13b5f00c1ea164b4509d2e015043a1d16939d0f82739a568051759" }, "downloads": -1, "filename": "python-scriptures-2.1.0.tar.gz", "has_sig": false, "md5_digest": "766f762001091b133a2c2994dcc96ed3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7504, "upload_time": "2014-05-09T01:30:13", "url": "https://files.pythonhosted.org/packages/df/65/9bb15938da5671583cef84101d4e7f786b50a5c195428bc6532640a56a9f/python-scriptures-2.1.0.tar.gz" } ], "2.1.2": [ { "comment_text": "", "digests": { "md5": "fca1c38a1901b17373bdca67bb6e0257", "sha256": "f2e243b2a1b170bef82768991ea563d21b7b1b3e8e7cf4954c713bac3a7f60e8" }, "downloads": -1, "filename": "python-scriptures-2.1.2.tar.gz", "has_sig": false, "md5_digest": "fca1c38a1901b17373bdca67bb6e0257", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7625, "upload_time": "2015-03-19T04:29:02", "url": "https://files.pythonhosted.org/packages/ce/08/cb02abaecc965fb93abf05147431f8f9758be7aa7ccf406468921ce0b4b6/python-scriptures-2.1.2.tar.gz" } ], "2.1.3": [ { "comment_text": "", "digests": { "md5": "af8c549946996c9eda3181113603a759", "sha256": "e8bc5e69a77008c90aedc5e7b5d569d2e9352666ff8e1741ea739208c75578b8" }, "downloads": -1, "filename": "python-scriptures-2.1.3.tar.gz", "has_sig": false, "md5_digest": "af8c549946996c9eda3181113603a759", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7607, "upload_time": "2015-03-19T13:24:43", "url": "https://files.pythonhosted.org/packages/52/70/9d88c48b6f080e4f22b6af81997cc3818300786347c28672555dad34018d/python-scriptures-2.1.3.tar.gz" } ], "2.2.0": [ { "comment_text": "", "digests": { "md5": "ad81dd0eeaac781cb42cfff6afa3bf5f", "sha256": "9059fe2a69c015db02949ec027fb989d9b9bc9250177f35b2f9130740d2c3f19" }, "downloads": -1, "filename": "python-scriptures-2.2.0.tar.gz", "has_sig": false, "md5_digest": "ad81dd0eeaac781cb42cfff6afa3bf5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7735, "upload_time": "2015-03-21T02:50:46", "url": "https://files.pythonhosted.org/packages/32/2b/05d4099f22c915ea021da14b38392d7f73379c57efb48eed4397fcaf1c8a/python-scriptures-2.2.0.tar.gz" } ], "2.2.1": [ { "comment_text": "", "digests": { "md5": "f61b67765f1387fe8eba4c45a6bf9fca", "sha256": "ef3dcd646cd596119317a57cf7b47651100c0732ce34477b63ad3816706a2075" }, "downloads": -1, "filename": "python-scriptures-2.2.1.tar.gz", "has_sig": false, "md5_digest": "f61b67765f1387fe8eba4c45a6bf9fca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7826, "upload_time": "2015-06-27T12:23:54", "url": "https://files.pythonhosted.org/packages/51/44/7354cebf0cdfe26c69c7d402a60c26b6e3e6ee7ddddfbc370a817f9bfdad/python-scriptures-2.2.1.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "c07e3a289c232f3b61d7b4abfae97ae9", "sha256": "24ed85f709c83c7479688957a1dcd073452bed26d328e99c80ea0d3087344c34" }, "downloads": -1, "filename": "python-scriptures-3.0.0.tar.gz", "has_sig": false, "md5_digest": "c07e3a289c232f3b61d7b4abfae97ae9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10930, "upload_time": "2016-12-29T21:42:42", "url": "https://files.pythonhosted.org/packages/a1/73/de23d891bcd6e0153c3c7ea856ae4c93ac49933a1e6b9d05c15d8f17816a/python-scriptures-3.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c07e3a289c232f3b61d7b4abfae97ae9", "sha256": "24ed85f709c83c7479688957a1dcd073452bed26d328e99c80ea0d3087344c34" }, "downloads": -1, "filename": "python-scriptures-3.0.0.tar.gz", "has_sig": false, "md5_digest": "c07e3a289c232f3b61d7b4abfae97ae9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10930, "upload_time": "2016-12-29T21:42:42", "url": "https://files.pythonhosted.org/packages/a1/73/de23d891bcd6e0153c3c7ea856ae4c93ac49933a1e6b9d05c15d8f17816a/python-scriptures-3.0.0.tar.gz" } ] }