Welcome to ldscriptures’s documentation!

Installing

Before using the library, we need to install it. The recommended installation method is the default Python module manager pip. You can also install it by downloading the project in Github and running the setup.py. Both methods will be explained in this article.

Installation via pip

The most basic way of installing LDSCriptures is using pip:

pip install ldscriptures

Of, if you want to update it:

pip install -U ldscriptures

Installing via setup.py

But if you want to do it the hard way, you’ll need to download the zip file containing the module, from Github.

Next, you need to extract the files. After extracting, you just need to run the following command in the directory that you extracted (replace “python” for you interpreter’s executable):

python setup.py install

Or, if you just want to build it:

python setup.py build

Usage/Tutorial

Ok, you liked the library, but you want to really start using it. Let’s start!

The get() function

The most basic and important thing you expect from a library that request and parses scriptural texts is a easy way of doing so. That’s exactly what the get function does. Let’s start with a simple example:

import ldscriptures as lds

scripture = lds.get('2 Nephi 28:30')

print(scripture.text)

Output:

2 Nephi 28

30 For behold, thus saith the Lord God: I will give unto the children of men line upon line, precept upon precept, here a little and there a little; and blessed are those who hearken unto my precepts, and lend an ear unto my counsel, for they shall learn wisdom; for unto him that receiveth I will give more; and from them that shall say, We have enough, from them shall be taken away even that which they have.

Ok, it’s kind a simple function, but I’ll explain everything is happenning here. In the first line, we import the ldscriptures module with the lds shortname. I did it for making the code easier to read, but it’s optional.

Then, in the second line we use the get() function for requesting for “2 Nephi 28:30”, and the Scripure object result we put at the scripture variable.

In the last line we printed the “text” attribute of “chapter”, wich is represented in the output above.

Acessing informations of the verses

If you want to retrieve the original html of each verse, you can access the .html attribute of the Verse object.

You can also use the .full, .content or number attributes to get other important info about the verse.

The Reference class

This is a powerful class that let’s you access the chapters, verses and scriptural book of a given valid reference (e.g. Ether 12:24). Example:

Output:

API Reference

The complete public API reference for LDScriptures.

Under Construction

What is ldscriptures?

ldscriptures is a Python module that lets you use the scriptures of The Church of Jesus Christ of Latter-day Saints (aka mormon). It was created to simplify the use of the scriptures and other LDS Church materials for developers who wanna include gospel materials in their softwares.

Some features are:

  • Simple and easy access to the scriptures using scriptural references (e.g., John 3:16, 1 Nephi 3:7, Moses 1-3)

  • Powerful Pythonic way to navigate the scriptures returned

  • And more!

Indices and tables