Skip to content

⚙️ FEATURE-#6: API ergonomics overhaul (v1.0.0)#7

Merged
FernandoCelmer merged 34 commits into
developfrom
feature/6
Apr 15, 2026
Merged

⚙️ FEATURE-#6: API ergonomics overhaul (v1.0.0)#7
FernandoCelmer merged 34 commits into
developfrom
feature/6

Conversation

@FernandoCelmer
Copy link
Copy Markdown
Member

@FernandoCelmer FernandoCelmer commented Apr 15, 2026

Closes #6

Refactors email_profile from the in-progress staging package into a clean, ergonomic v1.0.0 API. See the RFC in #6 for the full design.

Highlights

  • Lazy connect via with Email(...) as app: — no IO in __init__.
  • Provider factories: Email.gmail/outlook/hostinger/....
  • DNS auto-discovery: Email.from_email("you@yourdomain.com", "pw") resolves the IMAP host via known providers → SRV → MX hints → imap.<domain>.
  • High-level shortcuts: app.unread(), app.recent(7), app.search(text).
  • Cross-locale folder properties: app.inbox/sent/spam/trash/drafts/archive (EN/PT/ES name hints).
  • Validated Query (16 IMAP clauses) + composable Q builder (&, |, ~).
  • Where is lazy: count(), exists(), iter_messages() without RFC822 fetch.
  • Full RFC822 parsing: 39 named header fields + headers bag for the rest.
  • Storage for SQLite persistence + export_eml/import_eml + Email.restore / restore_eml to round-trip a backup back to any IMAP server.
  • MessageDumper separates DTO from filesystem IO.

Compatibility

Breaking. The legacy email_profile.{core,where,message,data,utils,abstract, models,serializers,cli} modules are removed. v0.5.x users will need to migrate to the new public API (see docs_src/).

Testing

  • 70 unit tests, all passing.
  • Smoke-tested against a real Hostinger account (~23k messages, including
    encoded headers, lowercase header variants, attachments).

Test plan

  • CI green
  • pytest tests/ green locally
  • Smoke run a docs_src/quickstart.py against a personal account

@FernandoCelmer FernandoCelmer changed the title ⚙️ FEATURE-#6: API ergonomics overhaul (v0.6.0) ⚙️ FEATURE-#6: API ergonomics overhaul (v1.0.0) Apr 15, 2026
@FernandoCelmer FernandoCelmer merged commit 03ded1f into develop Apr 15, 2026
11 checks passed
@FernandoCelmer FernandoCelmer deleted the feature/6 branch April 15, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant