{"id":18377528,"url":"https://github.com/richardbolt/python-bible","last_synced_at":"2025-04-06T21:31:40.008Z","repository":{"id":139391877,"uuid":"840413","full_name":"richardbolt/python-bible","owner":"richardbolt","description":"Python classes for Bible Verse and Passage - useful for storing, comparing, and formatting Bible references. Also includes Django form classes to make it easy to add Bible references to your Django models.","archived":false,"fork":false,"pushed_at":"2010-09-14T17:10:47.000Z","size":162,"stargazers_count":10,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T07:22:36.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richardbolt.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.markdown","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-08-16T06:14:03.000Z","updated_at":"2024-07-30T04:06:02.000Z","dependencies_parsed_at":"2023-03-11T14:26:33.136Z","dependency_job_id":null,"html_url":"https://github.com/richardbolt/python-bible","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardbolt%2Fpython-bible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardbolt%2Fpython-bible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardbolt%2Fpython-bible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardbolt%2Fpython-bible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richardbolt","download_url":"https://codeload.github.com/richardbolt/python-bible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247555197,"owners_count":20957720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T00:28:25.497Z","updated_at":"2025-04-06T21:31:39.759Z","avatar_url":"https://github.com/richardbolt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python Classes for manipulating Bible references\n------------------------------------------------\nPython classes for Bible Verse and Passage - useful for storing, comparing,\nand formatting Bible references. Also includes Django form classes to make it\neasy to add Bible references to your Django models.\n\nNote that this module does not let you actually pull and display the text\nof a Bible verse or passage - it is just for working with and displaying\nthe reference to the verses. Other tools and APIs can be used to grab and\ndisplay the actual verse text for a reference.\n\nIncluding the translation in a Verse object is optional, but if used, the\nomitted verses will be accounted for when interacting with the Verse or\nPassage that it is in. Passages can not combine two Verse objects that are\nnot from the same translation. While any translation can be entered and\nstored in the objects, the only ones with special data are: ESV, RSV, NIV,\nNASB, NRSV, NCV, and LB.\n\n\nVerse Object\n------------\nAttributes\n\n* book (book of Bible: 1-66)\n* chapter (chapter number)\n* verse (verse number)\n* translation (string: \"ESV\", \"NASB\", etc - or None)\n\nMethods\n\n* __str__(self)  # normalized string output (for saving to database)\n* format(self, format_string)  # outputs a nicely formatted string\n\n\nPassage Object\n--------------\nAttributes\n\n* start (Verse object)\n* end (Verse object)\n\nMethods\n\n* __len__(self)  # total number of verses included in passage\n* __str__(self)  # normalized string output (for saving to database)\n* __contains__(self, verse) # checks to see if a Verse is included in the Passage\n* format(self, format_string)  # outputs a nicely formatted string\n\n\nInstallation\n------------\nClone this repository into a folder named \"bible\" in your Python path. Alternatively -\nif you don't need the bleeding-edge updates and patches - you can use easy_install:\n\n    easy_install bible\n\nThat should get you up and running without having to mess with cloning or anything.\n\n\nExample Usage\n-------------\nBe sure you have this repository cloned into a folder named \"bible\" in your\nPython path before trying any of the examples below. The examples below show\ncommands and output as entered using the Python interactive terminal.\n\nUsing Verse Objects:\n\n    \u003e\u003e\u003e import bible\n    \n    \u003e\u003e\u003e v1 = bible.Verse('rom1:1')\n    \u003e\u003e\u003e v1.book\n    45\n    \u003e\u003e\u003e v1.format('B C:V')\n    Romans 1:1\n    \u003e\u003e\u003e str(v1)\n    45-1-1\n    \n    \u003e\u003e\u003e v = bible.Verse('Romans 17:1')\n    ...\n    RangeError: There are not that many chapters in Romans\n    \n    \u003e\u003e\u003e v = bible.Verse('Gen 1:50')\n    ...\n    RangeError: There is no verse 50 in Genesis 1\n    \n    \u003e\u003e\u003e v = bible.Verse('1-1-1')\n    \u003e\u003e\u003e v = bible.Verse('gen1:1')\n    \u003e\u003e\u003e v = bible.Verse('Genesis 1:1')\n    \u003e\u003e\u003e v = bible.Verse(1,1,1)\n\nUsing Passage Objects:\n    \n    \u003e\u003e\u003e import bible\n    \n    \u003e\u003e\u003e v1 = bible.Verse('rom1:1')\n    \u003e\u003e\u003e v2 = bible.Verse('rom1:8')\n    \u003e\u003e\u003e p = bible.Passage(v1,v2)\n    \u003e\u003e\u003e p.start.verse\n    1\n    \u003e\u003e\u003e p.end.verse\n    8\n    \u003e\u003e\u003e len(p)\n    8\n    \u003e\u003e\u003e Verse('rom1:4') in p\n    True\n    \u003e\u003e\u003e p.format('B C:V to b:c:v')\n    Romans 1:1 to Romans 1:8\n    \u003e\u003e\u003e p.format()\n    Romans 1:1-8\n        \n    \u003e\u003e\u003e p = bible.Passage(v1,v2)\n    \u003e\u003e\u003e p = bible.Passage(v1, 'Romans 1:8')\n    \u003e\u003e\u003e p = bible.Passage('rom1:1','rom1:8')\n\n\nDjango Forms\n------------\nWe've added a few additional classes to make it easy for you to use the bible\nmodule in your Django models. Here's how:\n\n    from bible.djangoforms import VerseField\n    \n    class Scripture(models.Model):\n        \"\"\"Sample model class using the VerseField type from the bible module\"\"\"\n        start_verse = VerseField()\n        end_verse = VerseField()\n\nUsed in the Django admin, or in your own forms, this will let the user enter\na verse in plain English, and attempt to interpret it into a Verse object.\nIf an exception is thrown, it will be passed through to the form for the user\nto fix it.\n\nIn the specific example above, given a model with start and end verses, a\nPassage object could be created in your view by combining the two Verse objects:\n\n    from bible import Passage\n    from myproject.myapp.models import Scripture\n    \n    s = Scripture.objects.get(id=1)\n    passage = Passage(s.start_verse, s.end_verse)\n\nWhich would then let you do something like this in your templates, assuming\nyou passed the passage variable in to the template context:\n\n    {{ passage.smart_format }}\n\nThere are no template tags or filters built in to the module yet, but they\nwould definitely be a good addition (thinking specifically of implementing\na template filter for Verse.format() like the date filters built in to Django)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardbolt%2Fpython-bible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichardbolt%2Fpython-bible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardbolt%2Fpython-bible/lists"}