⚙️ FEATURE-#6: API ergonomics overhaul (v1.0.0)#7
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6
Refactors
email_profilefrom the in-progress staging package into a clean, ergonomic v1.0.0 API. See the RFC in #6 for the full design.Highlights
with Email(...) as app:— no IO in__init__.Email.gmail/outlook/hostinger/....Email.from_email("you@yourdomain.com", "pw")resolves the IMAP host via known providers → SRV → MX hints →imap.<domain>.app.unread(),app.recent(7),app.search(text).app.inbox/sent/spam/trash/drafts/archive(EN/PT/ES name hints).Query(16 IMAP clauses) + composableQbuilder (&,|,~).Whereis lazy:count(),exists(),iter_messages()without RFC822 fetch.headersbag for the rest.Storagefor SQLite persistence +export_eml/import_eml+Email.restore/restore_emlto round-trip a backup back to any IMAP server.MessageDumperseparates 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 (seedocs_src/).Testing
encoded headers, lowercase header variants, attachments).
Test plan
pytest tests/green locallydocs_src/quickstart.pyagainst a personal account