o365
O365 - Microsoft Graph and Office 365 API made easy
What it is and what it does
O365 is a Python wrapper around Microsoft Graph and Office 365 REST APIs that abstracts away the complexity of OAuth, API pagination, timezone handling, and resource navigation. It lets you work with Office 365 resources—email, calendar, contacts, OneDrive, SharePoint—using straightforward Python objects and methods rather than raw HTTP calls.
The library handles common operational details automatically: OAuth token refresh, conversion between local and server datetimes, pagination through custom iterators, and switching between shared mailboxes or other users' resources. It includes a query helper for building OData filters and supports modular API components for extending functionality. The package is in production/stable status and supports Python 3.10 through 3.13.
Use it for:
- Automate email sending and retrieval from Office 365 mailboxes without managing OAuth or API pagination manually.
- Build calendar applications that sync with Outlook, handling timezone conversion and recurring events automatically.
- Access and manage SharePoint or OneDrive files programmatically from Python applications.
- Create bots or integrations that read contacts or send notifications through Office 365 accounts.
- Migrate or backup email and calendar data from Office 365 to other systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
O365 provides a Pythonic interface to Microsoft Graph and Office 365 APIs, enabling access to email, calendar, contacts, OneDrive, and SharePoint resources through a single abstraction layer.
Yes, if you need to integrate Office 365 resources into a Python application and want to avoid raw API calls. The library is mature, permissively licensed, and has low install friction. The 196-day release gap suggests a slower maintenance pace, so verify that active community support or your own maintenance capacity aligns with your project's needs before committing to it for mission-critical systems.
Install
o365 on PyPI
pip
pip install o365uv
uv add o365poetry
poetry add o365Installing o365
Before you install
Low install friction with six well-maintained runtime dependencies. The package is in production/stable status and supports modern Python versions (3.10–3.13), though it has been 196 days since the last release, suggesting a maintenance pace that may be slower than some actively developed alternatives.
License in practice
Licensed under Apache Software License (permissive), which allows commercial and private use with minimal restrictions, making it suitable for most projects without legal friction.
Quickstart
from O365 import Account
credentials = ('client_id', 'client_secret')
account = Account(credentials)
m = account.new_message()
m.to.add('recipient@example.com')
m.subject = 'Test'
m.body = 'Message body'
m.send()
Requires Microsoft OAuth credentials (client_id and client_secret) registered with Azure; automatic token refresh is handled by the library.
Verify before relying
- Extent of Microsoft Graph API coverage beyond the documented features (email, calendar, contacts, OneDrive, SharePoint).
- Performance characteristics and rate-limiting behavior under high-volume scenarios.
- Community activity and responsiveness to issues given the 196-day release gap.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — beautifulsoup4, msal, python-dateutil, requests, tzdata, tzlocal |
| Maintenance | aging — 196 days since the last release |
| First released | |
| Downloads | 4,285,402/month — #2,342 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: o365-2.1.9-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
microsoftgraph-pythonA Python wrapper for the Microsoft Graph API…
permissive · top 15,000 on PyPI
nylasOfficial Python SDK for the Nylas API platform,…
permissive · top 15,000 on PyPI
office365Wraps the O365 library to provide a…
permissive · top 15,000 on PyPI
office365-rest-python-clientPython client library for Microsoft 365 and…
permissive · top 5,000 on PyPI
exchangelibexchangelib is an ORM-style client library for…
permissive · top 5,000 on PyPI
sharepyHandles authentication to SharePoint Online and…
copyleft · top 15,000 on PyPI
SharePlumSharePlum provides a Python interface to…
permissive · top 5,000 on PyPI
msgraphfsProvides a filesystem interface to Microsoft…
permissive · top 5,000 on PyPI
dynamics365crm-pythonProvides a Python client for interacting with…
permissive · top 15,000 on PyPI
pyicloudPyiCloud provides Python access to iCloud web…
permissive · top 15,000 on PyPI