]> git.notmuchmail.org Git - notmuch/blob - README
notmuch: refactor stuff into a Notmuch class
[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 (available from
10 bitbucket.org, the source distribution and binary distribution come
11 without the documentation), you can create the documentation with
12 sphinx installed, go to the docs directory and "make html". A static
13 version of the documentation is available at:
14
15 http://packages.python.org/cnotmuch/
16
17 The current source code is being hosted at
18 http://bitbucket.org/spaetz/cnotmuch which also provides an issue
19 tracker, and release downloads. This package is tracked by the python
20 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).
21
22 The original source has been provided by (c)Sebastian Spaeth, 2010.
23 All code is available under the GNU GPLv3+ (see docs/COPYING) unless specified otherwise.
24
25
26 INSTALLATION & DEINSTALL
27 ------------------------
28
29 cnotmuch is available on pypi.python.org. This means you can do
30 "easy_install cnotmuch" on your linux box and it will get installed
31 into:
32
33 /usr/local/lib/python2.x/dist-packages/
34
35 For uninstalling, you'll need to remove the "cnotmuch-0.1-py2.x.egg"
36 directory and delete one entry in the "easy-install.pth" file in that
37 directory.
38
39 It needs to have a libnotmuch.so or libnotmuch.so.1 available in some
40 library folder or will raise an exception when loading.
41 "OSError: libnotmuch.so.1: cannot open shared object file: No such file or directory"
42
43
44 Usage
45 -----
46 For more examples of how to use the cnotmuch interface, have a look at the
47 notmuch "binary" and the generated documentation.
48
49 Example session:
50 >>>from cnotmuch import notmuch
51 >>>db = notmuch.Database("/home/spaetz/mail")
52 db.get_path()
53 '/home/spaetz/mail'
54 >>>tags = db.get_all_tags()
55 >>>for tag in tags: 
56 >>>  print tag
57 inbox
58 ...
59 maildir::draft
60 #---------------------------------------------
61
62 q = notmuch.Query(db,'from:Sebastian')
63 count = len(q.search_messages())
64 1300
65
66 #---------------------------------------------
67
68 >>>db = notmuch.Database("/home/spaetz/mailHAHA")
69 NotmuchError: Could not open the specified database
70
71 #---------------------------------------------
72
73 >>>tags = notmuch.Database("/home/spaetz/mail").get_all_tags()
74 >>>del(tags)
75
76
77 Building for a Debian package
78 ------------------------------
79 dpkg-buildpackage -i"\.hg|\/build"
80
81
82 Changelog
83 ---------
84 0.1   First public release
85 0.1.1 Fixed Database.create_query()
86 0.2.0 Implemented Thread() and Threads() methods
87 0.2.1 Implemented the remaining API methods, notably Directory() and Filenames()