[sword-devel] Python api?

Bryan L. Fordham sword-devel@crosswire.org
Mon, 25 Jun 2001 15:10:56 -0400

Jesse Jacobsen wrote:

> This would be most excellent from my POV.  For personal use, I've
> written a Python Bible search and extraction utility that makes use of
> exported Bible Works databases.  (I'm no longer running Windows.)
> I'm currently extending it with a module that knows the date of Easter
> for any given year and will serve up Church year data like lectionary
> readings for any given Sunday/festival, etc. 

I'd originally put a Bible into MySQL with a python script, then used
MySQLdb to run ad hoc searches.  Which was pretty groovy, in and of
itself, but with several shortcomings.  Anyway, I got to thinking about
Sword and figured that something like

>>> kjv = Bible('KJV')
>>> verse = kjv.getVerse('gen 1:1')
>>> verse
'In the beginning God created the heaven and the earth.'

would be very cool.  

> A Python API to Sword
> would allow me to plug the lectionary module into Sword to make an
> extremely useful and easily redistributable Church Year tool.

There are, by my calculations, roughly a bazillion things you can do
with something like that.

> I'm partial to Python because it fits the extremely limited and
> irregular time slots I have for programming.  I've been meaning to use
> some of that time for work on Gnome Sword, but it's harder to fit into
> my schedule.

Yup, and you can use it anywhere.  Like I said, a web interface is just
where I started.

So the impression I'm getting is this would be cool but does not
currently exist.  Can folks who've written interfaces to Sword clue me
in on where to start with it?  I figure just retrieving verses is the
logical place.

Won't be able to work on this for a couple of weeks, as I'm getting
married on Saturday... And I've never written anything like this with
Python.  I'm fairly confident I can hack it out, but if there's someone
else with more knowledge and/or time I'd be happy to help them out there
I can.

Bryan L. Fordham

"There is such a fine line between genius and stupidity."
- David St. Hubbins, "Spinal Tap"