Python Forum

Full Version: moving from tkinter to wxpython
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10
Ok, I have finished the json file.
This is important, because I will incorporate it into your code (next step).
The file now contains the complete king James bible and can be accessed by
volume = 'New Testament' or 'Old Testament'
book = 'Genesis', 'Ephesians', '1st Chronicles', etc.
chapter = 1, 2, ...
verse = 1, 2, ...
here's a very simple example to access Ephesians 3:7
all keys can be variables
import BiblePaths
import json

bpath = BiblePaths.BiblePaths()
with bpath.IndexedBible.open() as f:
    Bible = json.load(f)
verse = Bible['New Testament']['Ephesians']['3']['7']
print(verse)

count = len(Bible['Old Testament']['Genesis'])
print('Genesis has {} chapters'.format(count))

result:
Output:
Whereof I was made a minister, according to the gift of the grace of God given unto me by the effectual working of his power. Genesis has 52 chapters
the code has become too lengthy to post here, so it will be on github,
URL: github.com/Larz60p/Barrowman
give me ten minutes to get it up there.
Ok, you can download the zip file (or clone) here: https://github.com/Larz60p/Barrowman
put the zip in a directory named Bible, and upzip there.

first run needs internet access to get files:
python CreateChapterJson.py
that will download the King James text files used for creating the json file,
and then create the file.

I will work on incorporating it into your existing code next.
Thanks, It's amazing how hard you have been working on this. How would I change which Bible she would use? She would like the modern English one here: https://www.jw.org/en/publications/bible/ It's the 1984 edition. The later one only has audio for about half the books. Is that possible?
Take a look at how the bible is created: CreateChapterJson.py
You would have to modify that to work with the new data, or,
probably better, write a new one and preserve this one.

My time is up on this one after the incorporation into the original code,
probably today or tomorrow.

About once a month I pick something to sink my teeth into, this one just happened to fit the
bill this month. It might just as easily have been the Quran or TaNaKh as they all have their
individual challenges.
That's fine. Thanks very much for all you have done. I know my friend will appreciate it. I will make sure she knows that most, if not all of what she will end up with, is due to your guidance and expertise.
I am adding a scraper to get audio from: http://www.mp3bible.ca/playlistKJV/
which is copyright free. They will be placed in a separate directory, and added
to the existing JSON file. You can replace these with your own version, and make appropriate
changes to the file if you do so.
This site has all of the files.
still working on scraper.
quitting for the night
The scraper is almost done, actually it runs until Pslams, and then blows up.
Just the same, while I'm fixing that, I'll put it on github so that you can play with it.
There is new code in BiblePaths, and I may have changed something else also, so just download the
package.
It will download audio for all chapters, all books (until it blows up)
It automatically creates all necessary directories, but here's the layout:
(from src directory)
data/KingJames/audio/m3u - Playlists for all mp3's (don't use these to listen, as they require internet access)
data/KingJames/audio/Genesis, data/KingJames/audio/1Kings, etc. contain actual mp3 files.


Give me about 1/2 hour to get it done.
Github has been updated, let me know if there are any issues (other than the one I already know about)
There was one more update to github.
The audio download is now working.
The file locations have to be added to the json file, and
all incorporated into the GUI.
Looks like a finish tomorrow, barring any unforeseen circumstances, which never happens in software development, right?
Pages: 1 2 3 4 5 6 7 8 9 10