ecederstrand/exchangelib

Python client for Microsoft Exchange Web Services (EWS)

Python

1,274

2,278 commits

updated Jun 23, 2026

See the code

README

Exchange Web Services client library

This module is an ORM for your Exchange mailbox, providing Django-style access to all your data. It is a platform-independent, well-performing, well-behaving, well-documented, well-tested and simple interface for communicating with an on-premise Microsoft Exchange 2007-2016 server or Office365 using Exchange Web Services (EWS). Among other things, it implements autodiscover, and functions for searching, creating, updating, deleting, exporting and uploading calendar, mailbox, task, contact and distribution list items.

image image image image xscode

Teaser

Here's a short example of how exchangelib works. Let's print the first 100 inbox messages in reverse order:

from exchangelib import Credentials, Account

credentials = Credentials("john@example.com", "topsecret")
account = Account("john@example.com", credentials=credentials, autodiscover=True)

for item in account.inbox.all().order_by("-datetime_received")[:100]:
    print(item.subject, item.sender, item.datetime_received)

Documentation

Documentation is available at https://ecederstrand.github.io/exchangelib/. Source code documentation is available at https://ecederstrand.github.io/exchangelib/exchangelib/.

autodiscover
ews
exchange
exchange-web-services
hacktoberfest
microsoft
o365
office365
outlook
python

ecederstrand/exchangelib

Python client for Microsoft Exchange Web Services (EWS)

Python

1,274

2,278 commits

updated Jun 23, 2026

See the code

README

Exchange Web Services client library

This module is an ORM for your Exchange mailbox, providing Django-style access to all your data. It is a platform-independent, well-performing, well-behaving, well-documented, well-tested and simple interface for communicating with an on-premise Microsoft Exchange 2007-2016 server or Office365 using Exchange Web Services (EWS). Among other things, it implements autodiscover, and functions for searching, creating, updating, deleting, exporting and uploading calendar, mailbox, task, contact and distribution list items.

image image image image xscode

Teaser

Here's a short example of how exchangelib works. Let's print the first 100 inbox messages in reverse order:

from exchangelib import Credentials, Account

credentials = Credentials("john@example.com", "topsecret")
account = Account("john@example.com", credentials=credentials, autodiscover=True)

for item in account.inbox.all().order_by("-datetime_received")[:100]:
    print(item.subject, item.sender, item.datetime_received)

Documentation

Documentation is available at https://ecederstrand.github.io/exchangelib/. Source code documentation is available at https://ecederstrand.github.io/exchangelib/exchangelib/.

autodiscover
ews
exchange
exchange-web-services
hacktoberfest
microsoft
o365
office365
outlook
python

Project health

Overall

3.3/10

Maintained

0/10

Code review

1/10
OpenSSF Scorecard

Latest release

5.6.0 · Oct 10, 2025

Releases this year

0

Significant stargazers

Maged Saeed

198 followers · starred Sep 2021

Matthew John Cheetham

311 followers · starred Jul 2018

Mykola Orliuk

35 followers · starred Jan 2023

AAS

13 followers · starred Jan 2018