Which Python wrapper should I use?

If you want to access Xapian from Python, there are several wrappers available. Some of these are designed for specialist use, some of these are more general, and some are unmaintained and should be avoided.

Xapian's own Python bindings

These bindings are a (largely automatic) translation of the C++ API into Python. Some features (such as iterators) have been wrapped specially to give a more natural Python interface, but most of the interface simply mirrors the C++ API, and can be slightly clumsy to use from Python. There is currently little documentation specific to the Python bindings, but the C++ API documentation gives a good overview, and is semi-automatically translated to Python doccomments. The bindings allow complete access to all of Xapian's features. All the other known Xapian Python wrappers are implemented on top of these bindings, so you will need to install them even if you plan to use a higher level interface. The API is stable, and follows the same deprecation policy as Xapian's C++ API to ensure a reasonably easy upgrade path between releases.

Xappy

http://xappy.org/

Xappy is a wrapper around the Xapian Python bindings which aims to provide an easy-to-use interface for building search applications which mainly involve text indexing. It provides an abstraction layer supporting a persistent set of "fields" which are defined in a schema and used to allow flexible indexing and searching of content. It supports most Xapian features, including spelling correction and synonyms. It has reasonable documentation, including an introductory overview document and plenty of example code. It also has a large test suite. However, the API is not yet stabilised, so some work may be required to make applications built with current releases work with future releases.

A trade-off of providing a higher level API than the raw Xapian bindings is that Xappy is not quite as flexible as Xapian. It aims to cover a wide range of needs, but some projects will always need the full flexibility of raw Xapian.

(Disclaimer - this article was originally written by Richard Boulton, the author of Xappy.)

ore.xapian

http://pypi.python.org/pypi/ore.xapian

The package provides a content indexing framework for a multi-threaded Python application. It is built on top of Xappy, using the Zope component architecture.

FIXME - investigate this project and give more details about it.

Possibly Unmaintained Wrappers

The following wrappers seem to be unmaintained and out of date based on external evidence - please comment with details if you have any information to the contrary.

mbxap

http://code.google.com/p/mbxap/

High level binding for Xapian's Python/SWIG binding to quote the project site, but there doesn't seem to be an obvious more detailed description.

The most recent check-in seems to be July 2008, so this project doesn't seem to be very active.

Unmaintained Wrappers

These wrappers are known to be unmaintained, for example because their previous maintainers have explicitly said so.

PyXapian

PyXapian was a precursor of Xappy, and is now unmaintained. New projects should use Xappy instead.

XapWrap

http://divmod.org/projects/xapwrap

XapWrap is an old Python wrapper around Xapian, produced by divmod. According to http://divmod.org/trac/wiki/DivmodProjects, XapWrap is no longer being developed. The last known release was version 0.3, which works with Xapian 0.9.2, but not with Xapian 1.0.0 or later (and the bug for this was closed WONTFIX).

XAQL

XAQL is a specialised wrapper for producing Xapian queries from an SQL syntax. It doesn't appear to have its own website - the latest code we are aware of is in the PyXapian repository, but also worked with XapWrap at one point. This hasn't been updated since April 2007, and since both PyXapian and XapWrap are unmaintained, XAQL doesn't look too healthy either. The authors report "the QueryParser? seems to have improved a lot so we are using it now instead".

FAQ Index