]> git.notmuchmail.org Git - notmuch/blob - README
Make __VERSION__ available via cnotmuch.notmuch.__VERSION__ and improve README
[notmuch] / README
1 cnotmuch -- The python interface to notmuch.so
2 ==============================================
3
4 This module makes the functionality of the notmuch library
5 (`http://notmuchmail.org`_) available to python. Successful import of
6 this modul depends on a libnotmuch.so|dll being available on the
7 user's system.
8
9 If you have downloaded the full source tarball, you can create the
10 documentation with sphinx installed, go to the docs directory and
11 "make html". A static version of the documentation is available at:
12
13 `http://spaetz.bitbucket.org`_
14
15 The current source code is being hosted at
16 http://bitbucket.org/spaetz/cnotmuch which also provides an issue
17 tracker, and release downloads. This package is tracked by the python
18 package index repository at `http://pypi.python.org/pypi/cnotmuch`_ and can thus be installed on a user's computer easily via "sudo easy_install cnotmuch" (you will still need to install the notmuch shared library separately as it is not included in this package).
19
20 The original source has been provided by (c)Sebastian Spaeth, 2010.
21 All code is available under the GNU GPLv3+ (see docs/COPYING) unless specified otherwise.
22
23
24 Usage
25 -----
26 For more examples of how to use the cnotmuch interface, have a look at the
27 notmuch "binary" and the generated documentation.
28
29 Example session:
30 >>>from cnotmuch import notmuch
31 >>>db = notmuch.Database("/home/spaetz/mail")
32 db.get_path()
33 '/home/spaetz/mail'
34 >>>tags = db.get_all_tags()
35 >>>for tag in tags: 
36 >>>  print tag
37 inbox
38 ...
39 maildir::draft
40 #---------------------------------------------
41
42 q = notmuch.Query(db,'from:Sebastian')
43 count = len(q.search_messages())
44 1300
45
46 #---------------------------------------------
47
48 >>>db = notmuch.Database("/home/spaetz/mailHAHA")
49 NotmuchError: Could not open the specified database
50
51 #---------------------------------------------
52
53 >>>tags = notmuch.Database("/home/spaetz/mail").get_all_tags()
54 >>>del(tags)