]> git.cworth.org Git - notmuch-wiki/blob - bindings.mdwn
emacs 24 required for some smtpmail features
[notmuch-wiki] / bindings.mdwn
1 [[!img notmuch-logo.png alt="Notmuch logo" class="left"]]
2 # Notmuch Language Bindings [DRAFT]
3
4 The Notmuch library, `libnotmuch`, can be used from many programming languages
5 using the Notmuch language bindings. The [[command line interface|manpages]] and
6 the [[email clients and frontends|frontends]] are based on the language
7 bindings.
8
9 [[!toc levels=2]]
10
11 ## C and C++
12
13 `libnotmuch` is a shared C library. [The API](http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/notmuch.h)
14
15 The Notmuch command-line interface is based on the C library.
16
17 ## Python
18
19 Notmuch includes Python bindings to the Notmuch shared library. Please refer to
20 the nice and extensive [Notmuch Python API
21 documentation](http://notmuch.readthedocs.org/projects/notmuch-python/).
22
23 The bindings are very simple to use. As an example, given you have the Python
24 bindings installed (or simply set your PYTHONPATH environment variable to point
25 to the .../bindings/python directory), this snippet will produce a list of mails
26 matching the given expression:
27
28         >>> import notmuch
29         >>> db = notmuch.Database()
30         >>> query = db.create_query('tag:inbox AND NOT tag:killed')
31         >>> list(query.search_messages()) # doctest:+ELLIPSIS
32         [...]
33
34 [The source](http://git.notmuchmail.org/git/notmuch/tree/HEAD:/bindings/python/)
35
36 ## Ruby
37
38 [The source](http://git.notmuchmail.org/git/notmuch/tree/HEAD:/bindings/ruby/)
39
40 The [client for
41 vim](http://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README) is in Ruby,
42 so worth a look.
43
44 ## Go
45
46 [The source](http://git.notmuchmail.org/git/notmuch/tree/HEAD:/bindings/go/)