@@ -44,6 +44,33 @@ Features
44
44
- Convenience methods are provided for commonly used functionality.
45
45
- Exceptions are raised when errors occur.
46
46
47
+ Example
48
+ -------
49
+
50
+ .. code-block :: python
51
+
52
+ from imapclient import IMAPClient
53
+
54
+ # context manager ensures the session is cleaned up
55
+ with imapclient.IMAPClient(host = " imap.host.org" ) as client:
56
+ client.login(' someone' , ' secret' )
57
+ client.select_folder(' INBOX' )
58
+
59
+ # search criteria are passed in a straightforward way
60
+ # (nesting is supported)
61
+ messages = client.search([' NOT' , ' DELETED' ])
62
+
63
+ # fetch selectors are passed as a simple list of strings.
64
+ response = client.fetch(messages, [' FLAGS' , ' RFC822.SIZE' ])
65
+
66
+ # `response` is keyed by message id and contains parsed,
67
+ # converted response items.
68
+ for message_id, data in response.items():
69
+ print (' {id} : {size} bytes, flags={flags} ' .format(
70
+ id = message_id,
71
+ size = data[b ' RFC822.SIZE' ],
72
+ flags = data[b ' FLAGS' ]))
73
+
47
74
Why IMAPClient?
48
75
---------------
49
76
You may ask: "why create another IMAP client library for Python?
@@ -53,7 +80,7 @@ The problem with imaplib is that it's very low-level. It expects
53
80
string values where lists or tuples would be more appropriate and
54
81
returns server responses almost unparsed. As IMAP server responses can
55
82
be quite complex this means everyone using imaplib ends up writing
56
- their own flimsy parsing routines which break easily .
83
+ their own fragile parsing routines.
57
84
58
85
Also, imaplib doesn't make good use of exceptions. This means you need
59
86
to check the return value of each call to imaplib to see if what you
@@ -76,39 +103,25 @@ IMAPClient's manual is available at http://imapclient.readthedocs.io/.
76
103
Release notes can be found at
77
104
http://imapclient.readthedocs.io/#release-history.
78
105
79
- The Sphinx source for the documentation can be found under doc/src. If
80
- Sphinx is installed, the documentation can be rebuilt using::
81
-
82
- python setup.py build_sphinx
83
-
84
- See the imapclient/examples directory for examples of how to use
85
- IMAPClient. If the IMAPClient was installed from PyPI, the examples
86
- subdirectory can be found under the imapclient package in the
87
- installation directory.
106
+ See the `examples ` directory in the root of project source for
107
+ examples of how to use IMAPClient.
88
108
89
109
Current Status
90
110
--------------
91
- IMAPClient is currently under development but it is unlikely that
92
- the existing API will change in backwards-incompatible ways. Changes
93
- planned for the near future will only add extra functionality to the
94
- API.
95
-
96
111
You should feel confident using IMAPClient for production
97
112
purposes. Any problems found will be fixed quickly once reported.
98
113
114
+ In order to clearly communicate version compatibility, IMAPClient
115
+ will strictly adhere to the `Semantic Versioning <http://semver.org >`_
116
+ scheme from version 1.0 onwards.
117
+
99
118
The project's home page is http://imapclient.freshfoo.com/ (this
100
119
currently redirects to the IMAPClient Github site). Details about
101
120
upcoming versions and planned features/fixes can be found in the issue
102
- tracker on Github. The maintainer also blogs about IMAPClient
121
+ tracker on Github. The maintainers also blog about IMAPClient
103
122
news. Those articles can be found `here
104
123
<http://menno.io/tags/imapclient> `_.
105
124
106
- Versions
107
- --------
108
- In order to clearly communicate version compatibility, IMAPClient
109
- will strictly adhere to the `Semantic Versioning <http://semver.org >`_
110
- scheme from version 1.0 onwards.
111
-
112
125
Mailing List
113
126
------------
114
127
The IMAPClient mailing list can be used to ask IMAPClient related
133
146
Working on IMAPClient
134
147
---------------------
135
148
The `contributing documentation
136
- <http://imapclient.readthedocs.io/en/master/contributing.html> `_. contains
137
- information for those interested in improving IMAPClient and contributing back
138
- to the project.
149
+ <http://imapclient.rtfd.io/en/master/contributing.html> `_ contains
150
+ information for those interested in improving IMAPClient.
139
151
140
152
IMAP Servers
141
153
------------
@@ -162,16 +174,14 @@ interact module like this::
162
174
163
175
"Live" Tests
164
176
------------
165
- IMAPClient includes a series of functional tests which exercise
166
- it against a live IMAP account. It is useful for ensuring
177
+ IMAPClient includes a series of live, functional tests which exercise
178
+ it against a live IMAP account. These are useful for ensuring
167
179
compatibility with a given IMAP server implementation.
168
180
169
- The livetest functionality can also be accessed like this::
170
-
171
- python -m imapclient.livetest <livetest.ini> [ optional unittest arguments ]
181
+ The livetest functionality are run from the root of the project source
182
+ like this::
172
183
173
- Alternatively you can run the ``livetest.py `` script included with the
174
- source distribution. Use ``livetest.py --help `` to see usage.
184
+ python livetest.py <livetest.ini> [ optional unittest arguments ]
175
185
176
186
The configuration file format is
177
187
`described in the main documentation <http://imapclient.rtfd.io/#configuration-file-format >`_.
0 commit comments