skillfed

msgraph-sdk

The Microsoft Graph Python SDK

msgraph-sdk v1.61.0 8.1M downloads/30d#1,663 on PyPI625
Permissive license MIT Active released

What it is and what it does

The Microsoft Graph SDK for Python is an official client library that wraps the Microsoft Graph REST API, allowing Python applications to authenticate and call Microsoft services. It handles credential management through azure-identity, request serialization via kiota serialization libraries, and provides a fluent object model that mirrors the REST API structure. The SDK is async-first by design, using asyncio as its primary concurrency model, though it can be integrated into sync code.

You use it by registering an application, selecting an authentication credential type (ClientSecretCredential for daemon apps, DeviceCodeCredential or InteractiveBrowserCredential for user-interactive flows), creating a GraphServiceClient, and then calling methods on its fluent API to read and write data. The library handles HTTP transport, error handling, and response deserialization automatically.

Use it for:

  • Build daemon applications that read or modify user data, calendar events, or team information without user interaction.
  • Integrate Microsoft services data into custom Python applications or workflows.
  • Automate administrative tasks like user provisioning, group management, or license assignment.
  • Create Python-based bots or background services that interact with Microsoft Graph on a schedule.
  • Fetch user profile, presence, or organizational hierarchy data for identity and access control decisions.

Worth the install?

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

Python client library for calling Microsoft Graph APIs with async-first support, handling authentication, serialization, and request building against Microsoft services.

Yes. This is the official Microsoft Graph Python client, actively maintained with no known vulnerabilities and low install friction. Use it if you need to call Microsoft Graph APIs from Python—it's the standard choice for Microsoft service integration. The async-first design and comprehensive API coverage make it suitable for both simple scripts and production services, though you'll need to understand async/await patterns and have credentials ready.

Install

msgraph-sdk on PyPI

pip

pip install msgraph-sdk

uv

uv add msgraph-sdk

poetry

poetry add msgraph-sdk

Installing msgraph-sdk

Before you install

Low friction: pure Python wheel with 6 runtime dependencies. Active maintenance with a release 9 days ago; repo shows recent commits and 625 stars. Supports Python 3.10 through 3.14.

License in practice

MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install msgraph-sdk

from azure.identity.aio import ClientSecretCredential
from msgraph import GraphServiceClient

credential = ClientSecretCredential('tenant_id', 'client_id', 'client_secret')
client = GraphServiceClient(credentials=credential, scopes=['https://graph.microsoft.com/.default'])
user = await client.users.by_user_id('user_id').get()

Requires Python 3.10 or later. Requires Azure AD application registration and credentials. SDK is async-first; sync usage requires wrapping in asyncio or similar.

Verify before relying

  • Whether the package includes offline caching or request batching beyond what msgraph_core provides.
  • Performance characteristics when handling large result sets or concurrent requests.
  • Completeness of v1.0 API coverage relative to the full Microsoft Graph surface.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 6 — azure-identity, microsoft-kiota-serialization-json, microsoft-kiota-serialization-text, microsoft-kiota-serialization-form, microsoft-kiota-serialization-multipart, msgraph_core
Maintenance actively maintained — 9 days since the last release
Last repo commit
First released
Downloads 8,118,879/month — #1,663 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: msgraph_sdk-1.61.0-py3-none-any.whl

Keywords: msgraph, openAPI, Microsoft, Graph

Development Status :: 5 - Production/StableProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

microsoft graph api python clientazure identity python sdkmsgraph python async clientoffice api python integrationazure ad python sdkmicrosoft graph rest clientpython graph service client
async-firstazure-identitymicrosoft-graph

More WWW/HTTP packages