Skip to main content

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


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.7.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file aioimap-0.2.7.tar.gz.

File metadata

  • Download URL: aioimap-0.2.7.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4

File hashes

Hashes for aioimap-0.2.7.tar.gz
Algorithm Hash digest
SHA256 46e1669cb54340ee9a67b492149dd190f3973d37c586347bf115229bb8d73113
MD5 1925174caa43f39c806878a76276d145
BLAKE2b-256 3967701ca77c81368e62a18c5065120507389fa5c91473a41a4d1701c7f2a34c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page