Notmuch logo

Notmuch Language Bindings [DRAFT]

The Notmuch library, libnotmuch, can be used from many programming languages using the Notmuch language bindings. The command line interface and the email clients and frontends are based on the language bindings.

  1. Notmuch Language Bindings [DRAFT]
    1. C and C++
    2. Python
    3. Ruby
    4. Go

C and C++

libnotmuch is a shared C library. The API

The Notmuch command-line interface is based on the C library.

Python

Notmuch includes Python bindings to the Notmuch shared library. Please refer to the nice and extensive Notmuch Python API documentation.

The bindings are very simple to use. As an example, given you have the Python bindings installed (or simply set your PYTHONPATH environment variable to point to the .../bindings/python directory), this snippet will produce a list of mails matching the given expression:

    >>> from notmuch2 import Database
    >>> db = Database()
    >>> messages = list(db.messages('tag:inbox AND NOT tag:killed'))
    [...]

The source

Ruby

The source

The client for vim is in Ruby, so worth a look.

Go

The source