X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=bindings.mdwn;h=9352aba1d973051c1c818e634533c6782b201f4d;hb=14bd0939d030873725ced673ab2c86fa3b1e6e7f;hp=e52030c799ecdcd4a60638df4a532d9d73c5b9a2;hpb=6f90b0f48f05286ebefc3b6bc226ebb9cdad5b3c;p=notmuch-wiki diff --git a/bindings.mdwn b/bindings.mdwn index e52030c..9352aba 100644 --- a/bindings.mdwn +++ b/bindings.mdwn @@ -3,15 +3,44 @@ The Notmuch library, `libnotmuch`, can be used from many programming languages using the Notmuch language bindings. The [[command line interface|manpages]] and -many of the [[email clients and frontends|frontends]] are based on the language +the [[email clients and frontends|frontends]] are based on the language bindings. [[!toc levels=2]] ## C and C++ +`libnotmuch` is a shared C library. [The API](https://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/notmuch.h) + +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](http://notmuch.readthedocs.org/projects/notmuch-python/). + +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: + + >>> import notmuch + >>> db = notmuch.Database() + >>> query = db.create_query('tag:inbox AND NOT tag:killed') + >>> list(query.search_messages()) # doctest:+ELLIPSIS + [...] + +[The source](https://git.notmuchmail.org/git/notmuch/tree/HEAD:/bindings/python/) + ## Ruby +[The source](https://git.notmuchmail.org/git/notmuch/tree/HEAD:/bindings/ruby/) + +The [client for +vim](https://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README) is in Ruby, +so worth a look. + ## Go + +[The source](https://git.notmuchmail.org/git/notmuch/tree/HEAD:/contrib/go/)