👨‍🏫 Tutorial Create your own EasyWorship Bible

edna2000

Fanatic
So, armed with a hex editor and existing EWB files, I attempted to dig a little deeper into their EWB format. Here’s what we know so far:

  • EWB files are just an SQLite database
  • Verse metadata and the text itself are separately stored
  • Verses are stored as ZLib compressed data in a blob, per book
  • Every 8th byte in the ‘verse_info’ attribute of the ‘books’ table represents the Bible translation ID
  • Individual words are stored in a lookup table for the ‘search for passages by words or phrases’ functionality to work
To encode our own Bible translations, I needed to know exactly what the ‘book_info’ and ‘verse_info’ attributes stored. And as it turns out:

  • ‘book_info’: Number of chapters in the book, and number of verses in each chapter
  • ‘verse_info’: Length of the verse, position of where the verse starts in the text stream, verse number, chapter number, book number, translation ID
That is a very brief summary, but it is all documented in the code below - which, yes, allows you to encode your own Bibles for EasyWorship! All you need is an XML file of a Bible translation, which unfortunately might be the most challenging part, because there seems to be no singular standard for Bibles and scriptures.

For my script, I have settled on using Zefania XML - main reason being that the translations I was working with (and many other public domain translations) are readily available in that format (on SourceForge, and also You do not have permission to view the full content of this post. Log in or register now.). You can learn more about Zefania XML on You do not have permission to view the full content of this post. Log in or register now. and You do not have permission to view the full content of this post. Log in or register now..

Of course, that is not to say the script cannot be modified for other scripture formats - if you feel comfortable, knock yourself out! It should hopefully be more straightforward now with assistance below.
You do not have permission to view the full content of this post. Log in or register now.
 
Sorry lods sana may converter na pwde .xml bible to ewb sa easyworship. Thanks sa info lods. God bless you
The script converts XML to EWB files. Just paste it into VS Code, then run it in the terminal or command prompt. Make sure both the script and your XML Bible file are in the same folder.

Code:
EWB FORMAT DOCUMENTATION

SQLite database consisting of four tables

- books (metadata for books)
    - rowid: Chronological ID/number of book
    - name: Name of the book
    - abbrev_name: Standardised abbreviated name of the book - this value is the same for a given book across any translation
    - alt_name: English name of the book, usually inserted for non-English translations to aid easily searching for passages
    - book_info: Binary data storing number of chapters and number of verses in each chapter
        - First byte always stores the number of chapters in the book. If there is only one chapter, this is set to 0x00
        - Subsequent bytes store the number of verses in each chapter, chronologically (i.e. 2nd byte = no of verses in
            chapter 1, 3rd byte for chapter 2 etc)
    - verse_info: Binary data storing the verse-specific information for each verse in the book
        - Each verse in the book is represented by 8 bytes
        - First 4 bytes defines the length of the verse and a pointer for where that verse starts in the stream
            - 1st byte: Length of uncompressed text in verse (if >255, overflows into next 3 bytes)
            - 2nd-4th bytes: Pointer for starting position of verse in uncompressed stream (little endian)
        - Last 4 bytes defines the verse number, chapter number, book number and Bible translation ID
            - 1st byte: Verse number multiplied by 4 (if >255, overflows into next byte)
            - 2nd byte: Chapter number multiplied by 4 (if >255, overflows into next byte)
            - 3rd byte: Book number (same as rowid) multiplied by 4 (if >255, overflows into next byte)
            - 4th byte: Bible translation ID multiplied by 2 (hence why Bible IDs have a max value of 127)

- header (metadata for Bible translation)
    - rowid: Always value of 1
    - id: Unique ID for the Bible translation (valid range 1-127)
    - key: ID for Bible licensing, 0 = free
    - name: Full name of Bible translation
    - abbrev_name: Abbreviated name of Bible translation
    - lang_code: Two letter ISO-639 language code
    - plugin_version: Plugin version, assumed to be used for updates
    - format_version: Format version, assumed to be used for updates
    - copyright: Copyright notice in RTF
    - license: License notice in RTF

- streams (text for each book)
    - rowid: ID of the book (corresponding to books table)
    - stream: ZLib compressed stream of the book's text
        - Appears to use the best level of ZLib compression based on header
        - Last 10 bytes stores the length of the book's text before ZLib compression
            - First 4 bytes: unknown, possible header - always 51 4b 03 04 in hex
            - Next 4 bytes: packed little-endian 4-byte integer - length of text before compression
            - Last 2 bytes: unknown, possible footer - always 08 00 in hex

- words (lookup table for words)
    - rowid: ID of the word
    - word: Word that appears in the text
    - verse_info: Binary data storing where the word appears in the text
        - Each verse where the word appears is represented by 4 bytes
        - 1st byte: Length of uncompressed text in verse (if >255, overflows into next 3 bytes)
        - 2nd-4th bytes: Pointer for starting position of verse in uncompressed stream (little endian)
"""

✅ Step-by-Step: Properly Install Python (with PATH)

Download Python from the official site:
You do not have permission to view the full content of this post. Log in or register now.

Run the installer you download.

✅ VERY IMPORTANT: On the first installer screen, check this box:

[✔] Add Python to PATH

Then click "Install Now" and let it finish.

✅ After Installation

Once it's done, restart PowerShell or VS Code, and then run:

python --version

You should now see:

Python 3.x.x

Then you can run your script:
..............
To Run run.py in VS Code:

Open VS Code

Launch Visual Studio Code.

Extract and Open the Folder

If your file is in a folder, go to File > Open Folder, and open the folder containing run.py.

Check Your Python Environment

Make sure Python is installed and selected. You should see the selected interpreter at the bottom-left or top-right of the VS Code window. If not:

Run the Script

type: py run.py on the terminal
........
note: change this part to match your xml Bible
# Bible Metadata
bibleId = 201 (Change this part)
bibleName = 'Swahili Revised Union Version'(Change this part)
bibleNameAbbrev = 'SRUV'(Change this part)
bibleLangCode = 'SU'(Change this part)
bibleWordsSpaced = True

# Load Zefania XML Bible with error handling
xml_filename = 'SRUV.xml' (Change this part- this is your xml file)

You can edit the xml file exactly to match your bible

You do not have permission to view the full content of this post. Log in or register now.
 
The script converts XML to EWB files. Just paste it into VS Code, then run it in the terminal or command prompt. Make sure both the script and your XML Bible file are in the same folder.

Code:
EWB FORMAT DOCUMENTATION

SQLite database consisting of four tables

- books (metadata for books)
    - rowid: Chronological ID/number of book
    - name: Name of the book
    - abbrev_name: Standardised abbreviated name of the book - this value is the same for a given book across any translation
    - alt_name: English name of the book, usually inserted for non-English translations to aid easily searching for passages
    - book_info: Binary data storing number of chapters and number of verses in each chapter
        - First byte always stores the number of chapters in the book. If there is only one chapter, this is set to 0x00
        - Subsequent bytes store the number of verses in each chapter, chronologically (i.e. 2nd byte = no of verses in
            chapter 1, 3rd byte for chapter 2 etc)
    - verse_info: Binary data storing the verse-specific information for each verse in the book
        - Each verse in the book is represented by 8 bytes
        - First 4 bytes defines the length of the verse and a pointer for where that verse starts in the stream
            - 1st byte: Length of uncompressed text in verse (if >255, overflows into next 3 bytes)
            - 2nd-4th bytes: Pointer for starting position of verse in uncompressed stream (little endian)
        - Last 4 bytes defines the verse number, chapter number, book number and Bible translation ID
            - 1st byte: Verse number multiplied by 4 (if >255, overflows into next byte)
            - 2nd byte: Chapter number multiplied by 4 (if >255, overflows into next byte)
            - 3rd byte: Book number (same as rowid) multiplied by 4 (if >255, overflows into next byte)
            - 4th byte: Bible translation ID multiplied by 2 (hence why Bible IDs have a max value of 127)

- header (metadata for Bible translation)
    - rowid: Always value of 1
    - id: Unique ID for the Bible translation (valid range 1-127)
    - key: ID for Bible licensing, 0 = free
    - name: Full name of Bible translation
    - abbrev_name: Abbreviated name of Bible translation
    - lang_code: Two letter ISO-639 language code
    - plugin_version: Plugin version, assumed to be used for updates
    - format_version: Format version, assumed to be used for updates
    - copyright: Copyright notice in RTF
    - license: License notice in RTF

- streams (text for each book)
    - rowid: ID of the book (corresponding to books table)
    - stream: ZLib compressed stream of the book's text
        - Appears to use the best level of ZLib compression based on header
        - Last 10 bytes stores the length of the book's text before ZLib compression
            - First 4 bytes: unknown, possible header - always 51 4b 03 04 in hex
            - Next 4 bytes: packed little-endian 4-byte integer - length of text before compression
            - Last 2 bytes: unknown, possible footer - always 08 00 in hex

- words (lookup table for words)
    - rowid: ID of the word
    - word: Word that appears in the text
    - verse_info: Binary data storing where the word appears in the text
        - Each verse where the word appears is represented by 4 bytes
        - 1st byte: Length of uncompressed text in verse (if >255, overflows into next 3 bytes)
        - 2nd-4th bytes: Pointer for starting position of verse in uncompressed stream (little endian)
"""

✅ Step-by-Step: Properly Install Python (with PATH)

Download Python from the official site:
You do not have permission to view the full content of this post. Log in or register now.

Run the installer you download.

✅ VERY IMPORTANT: On the first installer screen, check this box:

[✔] Add Python to PATH

Then click "Install Now" and let it finish.

✅ After Installation

Once it's done, restart PowerShell or VS Code, and then run:

python --version

You should now see:

Python 3.x.x

Then you can run your script:
..............
To Run run.py in VS Code:

Open VS Code

Launch Visual Studio Code.

Extract and Open the Folder

If your file is in a folder, go to File > Open Folder, and open the folder containing run.py.

Check Your Python Environment

Make sure Python is installed and selected. You should see the selected interpreter at the bottom-left or top-right of the VS Code window. If not:

Run the Script

type: py run.py on the terminal
........
note: change this part to match your xml Bible
# Bible Metadata
bibleId = 201 (Change this part)
bibleName = 'Swahili Revised Union Version'(Change this part)
bibleNameAbbrev = 'SRUV'(Change this part)
bibleLangCode = 'SU'(Change this part)
bibleWordsSpaced = True

# Load Zefania XML Bible with error handling
xml_filename = 'SRUV.xml' (Change this part- this is your xml file)

You can edit the xml file exactly to match your bible

You do not have permission to view the full content of this post. Log in or register now.
Thank you lods pwde po ba magpagawa sa iyo lods. Nang cebuano Bible lods kailangan kasi sa easyworship namin namay cebuano kasi yun po dialect namin.
 

About this Thread

  • 32
    Replies
  • 3K
    Views
  • 15
    Participants
Last reply from:
Heshnell

Trending Topics

Online now

Members online
317
Guests online
976
Total visitors
1,293

Forum statistics

Threads
2,275,524
Posts
28,963,845
Members
1,232,833
Latest member
mohdsad
Back
Top