J
J
JRazor2016-04-24 13:59:17
Python
JRazor, 2016-04-24 13:59:17

Mail receiving + small backend + small API: what to use?

Good day!
There are several chairs: Twisted , Tornado and the standard POP/IMAP library + streams in Python 2.7 + Flask . I will not describe the pros and cons - I hope for answers from an audience that knows more than I do.
The main task is to parse emails and extract attachments by criteria. In the continuation there will be a light backend and a couple of API requests.
What to choose from the listed or not listed? Any sound ideas? The use of two frameworks is not suggested.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nirvimel, 2016-04-24
@JRazor

Twisted, Tornado

Nothing out of this. Let me explain: Firstly, both have their own non-standard IMAP implementations (in principle, it is possible to tie a standard one to Tornado), this would not be critical if it were not for the excellent options to get by with the standard imaplib / IMAPClient . Secondly, the frameworks themselves: Twisted is already somewhat outdated, interest in it is gradually fading, Tornado seems to still be kept at the expense of its fans, but it is also too specific and at the moment almost does not provide unique advantages (at the time of its development, its advantages were pretty unique).
For any tasks with asynchronous I/O, I advise you to choose from (in order of priority):
  1. Asyncio (python >= 3.4).
  2. Gevent .
  3. Standard threading . Their disadvantage is that not all I / O calls release the GIL for execution time (especially for python 2), for each specific task you have to write your own benchmark to prove / refute the real asynchrony and equivalence (in terms of performance) of the reference implementation, e.g. on gevent.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question