The current 1.5.9 SWORD library release requires a bit of fiddling to be accessible from python. This is on ArchLinux. I found good (if incomplete) information in a thread on the sword developers mailing list.
The SWORD Project is the CrossWire Bible Society’s free Bible software project. Its purpose is to create cross-platform open-source tools– covered by the GNU General Public License– that allow programmers and Bible societies to write new Bible software more quickly and easily.
- Upgrade to swig 1.3.31 or higher which supports python 2.5. This resolves a
compilation error caused by a const char*/char* mismatch. SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl, Ruby and PHP. tar xzvf sword-1.5.9.tar.gz
- From the Sword base directory where the .tar.gz file was extracted,
cd bindings/swig/package
- Edit configure.ac and correct the Sword version number in three
places. AC_INIT, AM_INIT_AUTOMAKE and the variable SW_CHECK_SWORD refers to the lowest
supported version of the Sword libraries. Bump it to 1.5.9. - Add libtoolize to the start of autogen.sh to resolve ./ltmain.sh not found
./autogen.sh
Create make files./configure
If necessary, specify other options such as –prefix
or –with-python=path. See configure –help for more information.make pythonswig
Generate the SWIG bindings and setup.py, required to generate Sword.cxxmake
If you just run make, it will create Makefiles for all the
language bindings found by configure.cd python; sudo ./setup.py install
Install Python Sword bindings (chmod +x might be necessary on setup.py)