EWS in Exchange Online is off by default since October 2026, and on 1 April 2027 Microsoft switches it off for good. ewsgraph is a Python library with exchangelib's API that runs on Microsoft Graph: change the import, keep the code.
- from exchangelib import Account, OAuth2Credentials, Q
+ from ewsgraph import Account, OAuth2Credentials, Q
The rest of the program stays as it is: account.inbox.filter(...),
msg.reply(...), calendar.view(...) and the ids
you stored with exchangelib keep working.
pip install ewsgraph
Python 3.10 to 3.13. Dependencies: httpx, msal, tzlocal.
Send, drafts, reply, forward, move, copy, delete; attachments of any
size; MIME, headers and threading fields; folders, paths and
walk().
filter() with every lookup, exclude(),
Q, order_by(), only(),
values(), slices, count(), query
strings.
Events with recurring series and meeting responses, free/busy, rooms; contacts and contact folders; tasks on Microsoft To Do.
sync_items() and sync_hierarchy() on Graph
delta queries; inbox rules; resolve_names() and
expand_dl(); automatic replies; bulk operations over
Graph $batch.
OAuth2Credentials with a client secret or a certificate,
delegate access and impersonation. ewsgraph doctor checks
your app registration and says which Graph permissions are
missing.
Not possible, because Microsoft Graph has no API for it:
public folders, the archive mailbox, export() /
upload(), pull and streaming subscriptions, Exchange servers
on premises. A call Graph cannot answer raises an error before any
request, never a silent None. The full list is on
PyPI.
On a Microsoft 365 test tenant with EWS still allowed, the same reads go through exchangelib over EWS and through ewsgraph over Graph, and the results are compared field by field: messages, bodies, attachments, headers, ids, events with every occurrence, contacts, folders, rules, tasks and more, in 64 steps.
Of 45 public projects that use exchangelib with OAuth, 35 use only what ewsgraph has.
More than 1,390 offline tests on Python 3.10 to 3.13, and live tests that write, send, move and delete on the tenant.
Free for personal and noncommercial use, for noncommercial organizations, and for work on open-source projects that depend on ewsgraph (PolyForm Noncommercial License 1.0.0 with an additional permission; both texts come in the package). Business use, such as running it for your company's own mail, needs a commercial license.
| Single App | Organization | |
|---|---|---|
| Applications | 1, with all its copies and environments | any number |
| Microsoft 365 tenants | 1 | 1 |
| Versions | every version released before 1 January 2028, without expiry | |
| Price | $599 | $1,490 |
One payment, not a subscription. Prices in US dollars; sales tax or VAT is added at checkout where it applies. Refund within 14 days, no questions asked.
Lemon Squeezy sells the license as merchant of record. The key arrives by
e-mail; record it with ewsgraph activate KEY --tenant TENANT.
The library never stops working for lack of a key: without one it says
once per process what to do.
The key check talks to Lemon Squeezy, not to us, and sends the key and the tenant you give it, never anything about mailboxes, messages or people. Details: Privacy.
A volume price for a service you run in your customers' tenants, moving a license to another tenant, anything else: support@sdsoftware.io.