Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vladimarius/imapy
Imapy: Imap for Humans
https://github.com/vladimarius/imapy
Last synced: 8 days ago
JSON representation
Imapy: Imap for Humans
- Host: GitHub
- URL: https://github.com/vladimarius/imapy
- Owner: vladimarius
- Created: 2015-05-14T13:08:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-12T10:33:19.000Z (3 months ago)
- Last Synced: 2024-08-12T11:55:48.845Z (3 months ago)
- Language: Python
- Homepage:
- Size: 235 KB
- Stars: 229
- Watchers: 11
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Authors: AUTHORS.rst
Awesome Lists containing this project
- starred-awesome - imapy - Imapy: Imap for Humans (Python)
README
Imapy: Imap for Humans
======================Imapy is an MIT Licensed IMAP library, written in Python.
It makes processing emails in your email box easy.Most existing Python modules for dealing with IMAP are extremely
low-level. They require the programmer to know the intricacies of IMAP
protocol and differences in IMAP server behaviour so that even
simple tasks require writing hundred lines of code.Imapy changes that.
.. code-block:: python
>>> box = imapy.connect(
host='imap.gmail.com',
username='[email protected]',
password='secret',
ssl=True)**Get all folder names:**
>>> names = box.folders()
**Get last 5 emails in 'Inbox' folder:**
>>> emails = box.folder('Inbox').emails(-5)
**Get unseen emails with Awesome in subject:**
>>> q = Q()
>>> emails = box.folder('Inbox').emails(
>>> q.subject('Awesome').unseen()
>>> )**Move messages sent by your boss to "Important" folder and mark them 'Flagged' and 'Unseen':**
>>> q = Q()
>>> emails = box.folder('Inbox').emails(
>>> q.sender('[email protected]').unseen()
>>> )
>>> for email in emails:
>>> email.move('Important').mark(['Flagged', 'Unseen'])
>>>**Print some email details:**
>>> for email in emails:
>>> print(email['from'], email['subject'])**Process all emails in 'Inbox' folder:**
>>> status = box.folder('Inbox').info()
>>> total = status['total']
>>> for t in range(1, total + 1):
>>> email = box.folder('Inbox').email(t)
>>> print(email['subject'])**Logout**
>>> box.logout()
You can see more examples `here `_
Installation
------------To install Imapy, simply:
.. code-block:: bash
$ pip install imapy
Miscellaneous
-------------
`Notes `_ & `TODO `_