1 .. cnotmuch documentation master file, created by
2 sphinx-quickstart on Tue Feb 2 10:00:47 2010.
4 .. currentmodule:: cnotmuch
6 Welcome to :mod:`cnotmuch`'s documentation
7 ===========================================
9 The :mod:`cnotmuch` module provides an interface to the `notmuch <http://notmuchmail.org>`_ functionality, directly interfacing to a shared notmuch library.
10 The classes :class:`notmuch.Database`, :class:`notmuch.Query` provide most of the core functionality, returning :class:`notmuch.Threads`, :class:`notmuch.Messages` and :class:`notmuch.Tags`.
12 .. moduleauthor:: Sebastian Spaeth <Sebastian@SSpaeth.de>
14 :License: This module is covered under the GNU GPL v3 (or later).
16 This page contains the main API overview of cnotmuch |release|.
18 Notmuch can be imported as::
20 from cnotmuch import notmuch
24 from cnotmuch.notmuch import Query,Database
26 More information on specific topics can be found on the following pages:
33 :mod:`notmuch` -- The Notmuch interface
34 =============================================
36 .. automodule:: cnotmuch.notmuch
38 :todo: Document nmlib,STATUS
40 :class:`Database` -- The underlying notmuch database
41 -----------------------------------------------------
43 .. autoclass:: Database([path=None[, create=False[, mode=MODE.READ_ONLY]]])
45 .. automethod:: create
47 .. automethod:: open(path, status=MODE.READ_ONLY)
49 .. automethod:: get_path
51 .. automethod:: get_version
53 .. automethod:: needs_upgrade
55 .. automethod:: upgrade
57 .. automethod:: get_directory
59 .. automethod:: add_message
61 .. automethod:: remove_message
63 .. automethod:: find_message
65 .. automethod:: get_all_tags
67 .. automethod:: create_query
69 .. note:: :meth:`create_query` was broken in release
70 0.1 and is fixed since 0.1.1.
72 .. attribute:: Database.MODE
74 Defines constants that are used as the mode in which to open a database.
77 Open the database in read-only mode
80 Open the database in read-write mode
82 .. autoattribute:: db_p
84 :class:`Query` -- A search query
85 -----------------------------------------------
89 .. automethod:: create
91 .. attribute:: Query.SORT
93 Defines constants that are used as the mode in which to open a database.
96 Sort by message date, oldest first.
99 Sort by message date, newest first.
102 Sort by email message ID
104 .. automethod:: set_sort
108 Instance attribute :attr:`sort` contains the sort order (see
109 :attr:`Query.SORT`) if explicitely specified via
110 :meth:`set_sort`. By default it is set to `None`.
112 .. automethod:: search_threads
114 .. automethod:: search_messages
116 .. automethod:: count_messages
118 .. #############################################
119 .. currentmodule:: cnotmuch.message
121 :class:`Messages` -- A bunch of messages
122 ----------------------------------------
124 .. autoclass:: Messages
126 .. automethod:: collect_tags
128 .. automethod:: __len__
130 :class:`Message` -- A single message
131 ----------------------------------------
133 .. autoclass:: Message
135 .. automethod:: get_message_id
137 .. automethod:: get_thread_id
139 .. automethod:: get_replies
141 .. automethod:: get_filename
146 This flag is automatically set by a
147 Query.search_threads on those messages that match the
148 query. This allows us to distinguish matches from the rest
149 of the messages in that thread.
151 .. automethod:: get_flag
153 .. automethod:: set_flag
155 .. automethod:: get_date
157 .. automethod:: get_header
159 .. automethod:: get_tags
161 .. automethod:: remove_tag
163 .. automethod:: add_tag
165 .. automethod:: remove_all_tags
167 .. automethod:: freeze
171 .. automethod:: format_as_text
173 .. automethod:: __str__
175 .. #############################################
176 .. currentmodule:: cnotmuch.tag
178 :class:`Tags` -- Notmuch tags
179 -----------------------------
184 .. automethod:: __len__
186 .. automethod:: __str__
189 .. #############################################
190 .. currentmodule:: cnotmuch.thread
192 :class:`Threads` -- Threads iterator
193 ------------------------------------
195 .. autoclass:: Threads
197 .. automethod:: __len__
199 .. automethod:: __str__
201 :class:`Thread` -- A single thread
202 ------------------------------------
204 .. autoclass:: Thread
206 .. automethod:: get_thread_id
208 .. automethod:: get_total_messages
210 .. automethod:: get_toplevel_messages
212 .. automethod:: get_matched_messages
214 .. automethod:: get_authors
216 .. automethod:: get_subject
218 .. automethod:: get_oldest_date
220 .. automethod:: get_newest_date
222 .. automethod:: get_tags
224 .. automethod:: __str__
226 .. #############################################
227 .. currentmodule:: cnotmuch.notmuch
229 :class:`Filenames` -- An iterator over filenames
230 ------------------------------------------------
234 :class:`Directoy` -- A directory entry in the database
235 ------------------------------------------------------
239 :exc:`NotmuchError` -- A Notmuch execution error
240 ------------------------------------------------
241 .. autoexception:: NotmuchError
244 This execption inherits directly from :exc:`Exception` and is raised on errors during the notmuch execution.
246 :class:`STATUS` -- Notmuch operation return status
247 --------------------------------------------------
248 .. autoclass:: STATUS