]> git.notmuchmail.org Git - notmuch/blob - docs/source/index.rst
Add Database.create_query() as a shorthand for db=Database();q=Query(db,"")
[notmuch] / docs / source / index.rst
1 .. cnotmuch documentation master file, created by
2    sphinx-quickstart on Tue Feb  2 10:00:47 2010.
3
4 .. currentmodule:: cnotmuch
5
6 Welcome to :mod:`cnotmuch`'s documentation
7 ===========================================
8
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.Messages` and :class:`notmuch.Tags`.
11
12 .. moduleauthor:: Sebastian Spaeth <Sebastian@SSpaeth.de>
13
14 :License: This module is covered under the GNU GPL v3 (or later).
15
16 This page contains the main API overview. More information on specific topics can be found on the following pages: (none here yet)
17
18 Notmuch can be imported as::
19
20  from cnotmuch import notmuch
21
22 or::
23
24  from cnotmuch.notmuch import Query,Database
25
26 .. toctree::
27    :maxdepth: 1
28
29
30 :mod:`notmuch` -- The Notmuch interface
31 =============================================
32
33 .. automodule:: cnotmuch.notmuch
34
35 :todo: Document nmlib,STATUS
36
37 :class:`Database` -- The underlying notmuch database
38 -----------------------------------------------------
39
40 .. autoclass:: Database([path=None[, create=False[, mode=MODE.READ_ONLY]]])
41
42    .. automethod:: create
43
44    .. automethod:: open(path, status=MODE.READ_ONLY)
45
46    .. automethod:: get_path
47
48    .. automethod:: get_version
49
50    .. automethod:: needs_upgrade
51
52    .. automethod:: upgrade
53
54    .. automethod:: get_directory
55
56    .. automethod:: add_message
57
58    .. automethod:: remove_message
59
60    .. automethod:: find_message
61
62    .. automethod:: get_all_tags
63
64    .. automethod:: create_query
65
66    .. attribute:: Database.MODE
67
68      Defines constants that are used as the mode in which to open a database.
69
70      MODE.READ_ONLY
71        Open the database in read-only mode
72
73      MODE.READ_WRITE
74        Open the database in read-write mode
75
76    .. autoattribute:: db_p
77
78 :class:`Query` -- A search query
79 -----------------------------------------------
80
81 .. autoclass:: Query
82
83    .. automethod:: create
84
85    .. attribute:: Query.SORT
86
87      Defines constants that are used as the mode in which to open a database.
88
89      SORT.OLDEST_FIRST
90        Sort by message date, oldest first.
91
92      SORT.NEWEST_FIRST
93        Sort by message date, newest first.
94
95      SORT.MESSAGE_ID
96        Sort by email message ID
97
98    .. automethod:: set_sort
99
100    .. automethod:: search_threads
101
102    .. automethod:: search_messages
103
104    .. automethod:: count_messages
105
106 :class:`Messages` -- A bunch of messages
107 ----------------------------------------
108
109 .. autoclass:: Messages
110
111    .. automethod:: collect_tags
112
113    .. automethod:: __len__
114
115 :class:`Message` -- A single message
116 ----------------------------------------
117
118 .. autoclass:: Message
119
120    .. automethod:: get_message_id
121
122    .. automethod:: get_thread_id
123
124    .. automethod:: get_replies
125
126    .. automethod:: get_filename
127
128    .. automethod:: get_flag
129
130    .. automethod:: set_flag
131    
132    .. automethod:: get_date
133
134    .. automethod:: get_header
135
136    .. automethod:: get_tags
137
138    .. automethod:: remove_tag
139
140    .. automethod:: add_tag
141
142    .. automethod:: remove_all_tags
143
144    .. automethod:: freeze
145
146    .. automethod:: thaw
147
148    .. automethod:: format_as_text
149
150    .. automethod:: __str__
151
152 :class:`Tags` -- Notmuch tags
153 -----------------------------
154
155 .. autoclass:: Tags
156    :members:
157
158    .. automethod:: __len__
159
160    .. automethod:: __str__
161
162 :class:`Threads` -- Threads iterator
163 ------------------------------------
164
165 To be implemented
166
167 :class:`Thread` -- A single thread
168 ------------------------------------
169
170 To be implemented
171
172 :class:`Filenames` -- An iterator over filenames
173 ------------------------------------------------
174
175 To be implemented
176
177 :class:`Directoy` -- A directory entry in the database
178 ------------------------------------------------------
179
180 To be implemented
181
182 :exc:`NotmuchError` -- A Notmuch execution error
183 ------------------------------------------------
184 .. autoexception:: NotmuchError
185    :members:
186
187    This execption inherits directly from :exc:`Exception` and is raised on errors during the notmuch execution.
188
189 :class:`STATUS` -- Notmuch operation return status
190 --------------------------------------------------
191 .. autoclass:: STATUS
192
193    To be documented
194
195 Indices and tables
196 ==================
197
198 * :ref:`genindex`
199 * :ref:`search`
200