The primary (and officially supported) way to access SWORD modules from Python is the SWIG wrappers, located in sword/bindings/swig in the SWORD source. BPBible uses them (afaik), but there should be some more self-contained examples...
Not finding any good examples, a few years ago I went off, figured out the ztext file format, and wrote my own parser in Python. It's the blog post that shows up when googling "sword python". But I agree with how Troy responded at the time: this should never be officially supported or encouraged. While my trivial re-implementation may be useful for someone wanting to develop new book file formats, my time would have been better spent improving the official Python API or its documentation. In short, I'm sorry I didn't write that example code a long time ago. -Ken PS - After posting that work, I wrote: My heart was definitely running away from God when I was working on this, as I realized right after getting up from the computer. It's sad how much I can be doing "Godly" things and have such a stubborn heart. It's why I need a living Savior ... to save me from my "righteousness"! :) And it doesn't help my battle with my pride and self-directedness to praise my "skills" and "talent". On Wed, Sep 29, 2010 at 5:31 PM, Robert Hunt <[email protected]> wrote: > Dear all, > > I see that the page http://www.crosswire.org/wiki/DevTools:Code_Examples > has a heading for "Python" but no sample code there, and a site search for > Python didn't find anything helpful. > > It seems from emails flashing by that Python bindings for SWORD are > available??? Is there any documentation or help to get started? > > (I haven't actually found out where to find any of the SWORD code yet, so > maybe there's documentation there???) > > Thanks, > Robert. > > _______________________________________________ > sword-devel mailing list: [email protected] > http://www.crosswire.org/mailman/listinfo/sword-devel > Instructions to unsubscribe/change your settings at above page > _______________________________________________ sword-devel mailing list: [email protected] http://www.crosswire.org/mailman/listinfo/sword-devel Instructions to unsubscribe/change your settings at above page
