Skip to main content

API for managing your email

Project description

Email-Manager

Lightweight Python toolkit for working with email via IMAP (read/search) and SMTP (send), with optional AI assistant features (summaries, reply templates, and more).
Provides a simple high-level EmailManager plus a flexible EasyIMAPQuery builder for composing IMAP queries without worrying about low-level protocol details.


Installation

Install from PyPI:

pip install email-manager

Features

  • Base functionality via SMTP and IMAP (sends, search, fetch)
  • Compose IMAP queries using a compact builder pattern
  • Designed to be minimal, testable, and framework-agnostic
  • Supports AI assistants (e.g., automated summaries, reply templates, and more upcoming)

Core Concepts

EmailManager

EmailManager coordinates the IMAP and SMTP layers.
You create it once with the necessary clients/auth, then use it to send emails or navigate mailboxes.


EasyIMAPQuery

EasyIMAPQuery is a query builder used to construct IMAP search expressions before executing them.
It abstracts away raw IMAP tokens, letting you express filters more naturally, and only hits the server when you call a search/fetch method on it (from the manager).


Example Usage

Initialize an EmailManager with your own IMAP/SMTP clients:

from email_management.email_manager import EmailManager
from email_management.smtp import SMTPClient
from email_management.imap import IMAPClient

# Password Authentication
# Use when your provider allows direct username/password IMAP and SMTP login.
from email_management.auth import PasswordAuth
auth = PasswordAuth(username="you@example.com", password="secret")

# or use OAuth2Auth
# Use for providers like Gmail or Outlook where SMTP/IMAP require OAuth tokens.
# from email_management.auth import OAuth2Auth
# def token_provider():
#     # Must return a fresh OAuth2 access token string
#     return get_access_token_somehow()

auth = OAuth2Auth(username="you@example.com", token_provider=token_provider)

smtp = SMTPClient(host="smtp.example.com", port=587, auth=auth)
imap = IMAPClient(host="imap.example.com", port=993, auth=auth)

mgr = EmailManager(imap=imap, smtp=smtp)

Now you can use mgr wherever you need to send or browse email.


License

MIT

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

email_management-0.1.1.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

email_management-0.1.1-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file email_management-0.1.1.tar.gz.

File metadata

  • Download URL: email_management-0.1.1.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for email_management-0.1.1.tar.gz
Algorithm Hash digest
SHA256 282c1556c8d1cc298a01194d8e069e6c21b5796e2ce24422ea116bfe644e6827
MD5 d6fee99fbcc4be7347848893b29fb70e
BLAKE2b-256 6ee05a5d20e9fcca2e179247d626e60696c5a1f99cec1a2a4dfb236dd3772be9

See more details on using hashes here.

File details

Details for the file email_management-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for email_management-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 052373d614f027a8964fc3909e807d4444005cd5266a44911d00e37f6b9f5e19
MD5 da0bcc6ba5ec88a7cb94abcdfefc7cc5
BLAKE2b-256 8a45db59dbe9f980e209029c536c6e8a42d58e9b73413c45fa90ed5c060c1b49

See more details on using hashes here.

Supported by

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