[sword-devel] What is the command to retrieve text by args like "Genesis 1:1"

Jonathan Morgan jonmmorgan at gmail.com
Fri May 8 17:43:56 MST 2009


On Sat, May 9, 2009 at 2:17 AM, Wei-Wei Guo <wwguocn at gmail.com> wrote:
> Luke Plant 写道:
>
> Hi Luke,
>
>> I'm presuming you want to write in Python.  You need to build the Sword
>> Python SWIG bindings (from the sword source tarball), and I have some Python
>> code here which should provide a basis for what you need.
>>
>>
>> http://hg.lukeplant.me.uk/python/luke/file/b146cdf1a8c9/lukeplant_me_uk/bibleverses/sword.py
>>
>> The function "get_bible_text()" is what you need to look at, the rest may
>> or may not be relevant.
>>
>> The code seems somewhat cumbersome, there may be an easier way.  Also, the
>> process of converting to plain text is somewhat hacky, and I only
>> implemented what I needed (I mainly use the ESV module).
>
> I never know Sword has primitive Python bindings. It's good to know it.
> Thanks a lot!

BPBible is almost exclusively written in Python, and Ben is the
maintainer of the SWIG bindings.  BPBible has considerable
customisations of the raw SWIG bindings and filters to make them work
the way we want them to, which may or may not be of use to you.  These
are in the BPBible packages swlib and backend.

Jon



More information about the sword-devel mailing list