skillfed

microsoftgraph-python

API wrapper for Microsoft Graph written in Python

microsoftgraph-python v1.1.8.1 98.1K downloads/30d#13,107 on PyPI
Permissive license MIT DORMANT released

What it is and what it does

microsoftgraph-python is a Python client library that wraps the Microsoft Graph REST API, handling OAuth 2.0 authentication and providing a structured object-oriented interface to Microsoft 365 services. It abstracts away the complexity of direct HTTP calls to Graph endpoints, offering methods to interact with mail, calendar, contacts, files (OneDrive), OneNote, and Excel workbooks on behalf of authenticated users.

The library returns Response objects (wrapping the underlying requests library response) with `.data` attributes containing parsed API results, supports automatic pagination of large result sets, and allows injection of custom request hooks for logging or middleware. It targets v1.0 Graph endpoints by default but can be configured to use beta endpoints. However, the package has been dormant for over two years, so it may lag behind Microsoft's API evolution or security updates.

Use it for:

  • Build a Python application that reads and sends emails, manages calendar events, or accesses contacts on behalf of a user via OAuth 2.0.
  • Automate file operations (upload, download, search) in a user's OneDrive or SharePoint via the Graph API without direct SDK dependencies.
  • Create or update Excel workbooks and worksheets programmatically through Graph's workbook session management.
  • Integrate Microsoft 365 data (mail, calendar, contacts) into a custom dashboard or reporting tool.
  • Log all Graph API requests to a database or monitoring system using the requests_hooks parameter.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python wrapper for the Microsoft Graph API that handles OAuth 2.0 authentication and provides structured access to Microsoft 365 resources including mail, calendar, contacts, files, and OneNote.

Yes, if you need a lightweight Python wrapper for Microsoft Graph and can accept dormant maintenance. The low install friction (only requests dependency), MIT license, and broad API coverage make it suitable for straightforward Graph integration. However, verify that the endpoints you need are stable and that the package's v1.0.0+ breaking changes align with your use case; consider monitoring for security updates independently since active maintenance has stalled.

Install

microsoftgraph-python on PyPI

pip

pip install microsoftgraph-python

uv

uv add microsoftgraph-python

poetry

poetry add microsoftgraph-python

Installing microsoftgraph-python

Before you install

Low install friction with only requests as a runtime dependency. Package is dormant (858 days since last release), so no active maintenance or bug fixes should be expected, though it supports current Python versions (3.7–3.12).

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license notice.

Quickstart

pip install microsoftgraph-python

from microsoftgraph.client import Client

client = Client('CLIENT_ID', 'CLIENT_SECRET')
url = client.authorization_url(redirect_uri, scope)
response = client.users.get_me()

Requires a Microsoft Azure app registration with CLIENT_ID and CLIENT_SECRET; OAuth 2.0 authorization flow must be completed before API calls can be made.

Verify before relying

  • Whether the package's v1.0.0+ API changes are fully backward-compatible or if migration from earlier versions requires code rewrites.
  • Current state of the Microsoft Graph API endpoints the wrapper targets—whether they remain stable or have undergone breaking changes since the last release.
  • Whether auto-pagination (enabled by default) works correctly for all endpoint types or has known limitations.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests
Maintenance dormant — 858 days since the last release
First released
Downloads 98,113/month — #13,107 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: microsoftgraph_python-1.1.8.1-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

microsoft graph api pythonoffice 365 api wrappermicrosoft 365 python clientoauth 2.0 microsoft authenticationexchange calendar mail pythononedrive sharepoint pythonmicrosoft graph rest api
microsoft-365oauth-2.0rest-api-client

More WWW/HTTP packages