# msgraph-sdk

> The Microsoft Graph Python SDK

- **URL**: https://www.freshcrate.ai/projects/msgraph-sdk
- **Author**: pypi
- **Category**: Developer Tools
- **Latest version**: `v1.58.0` (2026-05-20)
- **License**: Unknown
- **Source**: https://github.com/microsoftgraph/msgraph-sdk-python/docs
- **Homepage**: https://pypi.org/project/msgraph-sdk/
- **Language**: Python
- **GitHub**: 598 stars, 86 forks
- **Registry**: pypi (`msgraph-sdk`)
- **Tags**: `graph`, `microsoft`, `msgraph`, `openapi`, `pypi`

## Description

# Microsoft Graph SDK for Python

[![PyPI version](https://badge.fury.io/py/msgraph-sdk.svg)](https://badge.fury.io/py/msgraph-sdk)
[![Downloads](https://pepy.tech/badge/msgraph-sdk)](https://pepy.tech/project/msgraph-sdk)
[![Supported Versions](https://img.shields.io/pypi/pyversions/msgraph-sdk.svg)](https://pypi.org/project/msgraph-sdk)
[![Contributors](https://img.shields.io/github/contributors/microsoftgraph/msgraph-sdk-python.svg)](https://github.com/microsoftgraph/msgraph-sdk-python/graphs/contributors)

Get started with the Microsoft Graph SDK for Python by integrating the [Microsoft Graph API](https://docs.microsoft.com/graph/overview) into your Python application.

> **Note:**
>
> * This SDK allows you to build applications using the [v1.0](https://docs.microsoft.com/graph/use-the-api#version) of Microsoft Graph. If you want to try the latest Microsoft Graph APIs, try the [beta](https://github.com/microsoftgraph/msgraph-beta-sdk-python) SDK.  

## 1. Installation

```py
pip install msgraph-sdk
```

> **Note:**
>
> * The Microsoft Graph SDK for Python is a fairly large package. It may take a few minutes for the initial installation to complete.
> * Enable long paths in your environment if you receive a `Could not install packages due to an OSError`. For details, see [Enable Long Paths in Windows 10, Version 1607, and Later](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later).

## 2. Getting started with Microsoft Graph

### 2.1 Register your application

Register your application by following the steps at [Register your app with the Microsoft Identity Platform](https://docs.microsoft.com/graph/auth-register-app-v2).

### 2.2 Select and create an authentication provider

To start writing code and making requests to the Microsoft Graph service, you need to set up an authentication provider. This object will authenticate your requests to Microsoft Graph. For authentication, the Microsoft Graph Python SDK supports both sync and async credential classes from Azure Identity. Which library to choose depends on the type of application you are building.

> **Note**: For authentication we support both `sync` and `async` credential classes from `azure.identity`. Please see the azure identity [docs](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity?view=azure-python) for more information.

The easiest way to filter this decision is by looking at the permissions set you'd use. Microsoft Graph supports 2 different types of permissions: delegated and application permissions:

* Application permissions are used when you don’t need a user to login to your app, but the app will perform tasks on its own and run in the background.
* Delegated permissions, also called scopes, are used when your app requires a user to login and interact with data related to this user in a session.

The following table lists common libraries by permissions set.
| MSAL library | Permissions set | Common use case |
|---|---|---|
| [ClientSecretCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.aio.clientsecretcredential?view=azure-python&preserve-view=true) | Application permissions | Daemon apps or applications running in the background without a signed-in user. |
| [DeviceCodeCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.devicecodecredential?view=azure-python) | Delegated permissions | Enviroments where authentication is triggered in one machine and completed in another e.g in a cloud server. |
| [InteractiveBrowserCredentials](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.interactivebrowsercredential?view=azure-python) | Delegated permissions | Environments where a browser is available and the user wants to key in their username/password. |
| [AuthorizationCodeCredentials](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.authorizationcodecredential?view=azure-python) | Delegated permissions | Usually for custom customer applications where the frontend calls the backend and waits for the authorization code at a particular url. |

You can also use [EnvironmentCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.environmentcredential?view=azure-python), [DefaultAzureCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python), [OnBehalfOfCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.onbehalfofcredential?view=azure-python), or any other [Azure Identity library](https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#credential-classes).

Once you've picked an authentication library, we can initiate the authentication provider in your app. The following example uses ClientSecretCredential with application per

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v1.58.0` | 2026-05-20 | High | ## [1.58.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.57.0...v1.58.0) (2026-05-20)   ### Features  * drop Python 3.9 and add Python 3.14 support across packaging, CI, and docs ([#1481](https://github.com/microsoftgraph/msgraph-sdk-python/issues/1481)) ([9d3a8c8](https://github.com/microsoftgraph/msgraph-sdk-python/commit/9d3a8c83e6ffc44ae44b0131de212b47b7980809)) * **generation:** update request builders and models ([#1483](https://github.com/microsoftgraph/msgraph-sdk-pyth |
| `v1.57.0` | 2026-05-07 | High | ## [1.57.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.56.0...v1.57.0) (2026-05-05)   ### Features  * **generation:** update request builders and models ([8f65301](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8f65301f1e27eb54922fb3be4568b78c4c605ecd)) * **generation:** update request builders and models ([54ae3ef](https://github.com/microsoftgraph/msgraph-sdk-python/commit/54ae3effa844bae1a27b3184e58fec9808317f81)) |
| `1.56.0` | 2026-04-21 | Low | Imported from PyPI (1.56.0) |
| `v1.56.0` | 2026-04-17 | High | ## [1.56.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.55.0...v1.56.0) (2026-04-16)   ### Features  * **generation:** update request builders and models ([8b6bb43](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8b6bb4360cf4aeeb4e6972906b8fd58126734ffd)) |
| `v1.56.0` | 2026-04-17 | High | ## [1.56.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.55.0...v1.56.0) (2026-04-16)   ### Features  * **generation:** update request builders and models ([8b6bb43](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8b6bb4360cf4aeeb4e6972906b8fd58126734ffd)) |
| `v1.56.0` | 2026-04-17 | Medium | ## [1.56.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.55.0...v1.56.0) (2026-04-16)   ### Features  * **generation:** update request builders and models ([8b6bb43](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8b6bb4360cf4aeeb4e6972906b8fd58126734ffd)) |
| `v1.56.0` | 2026-04-17 | Medium | ## [1.56.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.55.0...v1.56.0) (2026-04-16)   ### Features  * **generation:** update request builders and models ([8b6bb43](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8b6bb4360cf4aeeb4e6972906b8fd58126734ffd)) |
| `v1.56.0` | 2026-04-17 | Medium | ## [1.56.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.55.0...v1.56.0) (2026-04-16)   ### Features  * **generation:** update request builders and models ([8b6bb43](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8b6bb4360cf4aeeb4e6972906b8fd58126734ffd)) |
| `v1.56.0` | 2026-04-17 | Medium | ## [1.56.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.55.0...v1.56.0) (2026-04-16)   ### Features  * **generation:** update request builders and models ([8b6bb43](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8b6bb4360cf4aeeb4e6972906b8fd58126734ffd)) |
| `v1.56.0` | 2026-04-17 | Medium | ## [1.56.0](https://github.com/microsoftgraph/msgraph-sdk-python/compare/v1.55.0...v1.56.0) (2026-04-16)   ### Features  * **generation:** update request builders and models ([8b6bb43](https://github.com/microsoftgraph/msgraph-sdk-python/commit/8b6bb4360cf4aeeb4e6972906b8fd58126734ffd)) |

## Citation

- HTML: https://www.freshcrate.ai/projects/msgraph-sdk
- Markdown: https://www.freshcrate.ai/projects/msgraph-sdk.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/msgraph-sdk/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
