wiki:FAQ/PythonWrappers

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 are more general, and some are unmaintained and should be avoided.

Xapian's own Python 2 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 a "getting started" guide with python examples of a lot of the main functionality of Xapian, and the C++ API documentation gives a good overview of everything else, 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 2 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.

Xapian's own Python 3 bindings

Xapian 1.3.2 and later have decent bindings for Python 3 - you'll need to use these if you're using Python 3.

They should be automatically enabled if you just run ./configure and have the required Python 3 development tools installed, or you can specify them explicitly using ./configure --with-python3. These bindings were originally based on the Python 2 bindings, and have a very similar API, so porting over code shouldn't be painful.

Note that if you're using homebrew on macOS, you'll have to do a tiny amount more work, manually installing the sphinx python package into homebrew's python3 first: pip3 install sphinx.

xapian-haystack

https://github.com/notanumber/xapian-haystack/

xapian-haystack is a backend written with the Xapian python bindings. It works with Django Haystack to provide an easy to use interface for working with Django and Xapian.

Probably 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.

djapian

https://github.com/daevaorn/djapian

Djapian is a Django extension to provide configurable indexing and search of Django models. It's built on Xapian's own python bindings. The last substantive change was in 2012.

mbxap

https://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, or because they don't work with any currently supported version of Xapian.

Xappy

https://code.google.com/p/xappy/

Xappy was a wrapper around the Xapian Python bindings which aimed to provide an easy-to-use interface for building search applications which mainly involve text indexing. However, it is no longer maintained.

PyXapian

PyXapian was a precursor of Xappy, and is now also unmaintained.

XapWrap

http://divmod.org/projects/xapwrap

XapWrap was an older 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 the authors report "the QueryParser seems to have improved a lot so we are using it now instead".

ore.xapian

https://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. But Xappy is no longer maintained (see above), and the last ore.xapian release was 0.5.0 in November 2008.

FAQ Index

Last modified 7 years ago Last modified on 07/02/17 16:03:26
Note: See TracWiki for help on using the wiki.