Receive e-mails from an IMAP server asynchronously and trigger a callback with the message.
Project description
aioimap: Asyncio IMAP client
Receive e-mails from an IMAP server asynchronously and trigger a callback with the message.
Dependencies
aioimap requires:
- Python (>=3.7)
- aioimaplib (>=0.7.18)
- python-dotenv
- fastapi (>=0.61)
- uvicorn (>=0.12)
Usage
Assume a project structure as so:
project
|
|--app.py
|--.env
app.py:
from aioimap import Message
def callback(m: Message):
print("Subject: {}".format(m.subject))
print("Sender: {}".format(m.sender))
# do some other fun stuff
Terminal (without .env file):
cd path/to/project
python -m aioimap --host <EMAILSERVER> -u <EMAILID> -p <PWD> -a "app:callback"
If you have a .env file in the same directory:
SERVER=<EMAILSERVER>
EMAIL=<EMAILID>
PASS=<PWD>
Then Terminal (with .env file):
cd path/to/project
python -m aioimap -a "app:callback"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioimap-0.2.1.tar.gz
(5.1 kB
view hashes)