skillfed

office365-rest-python-client

Microsoft 365 & Microsoft Graph Library for Python

office365-rest-python-client v3.0.0 17.3M downloads/30d#1,124 on PyPI1,716
Permissive license The MIT License (MIT) Copyright (c) 2016 Vadim Gremyachev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) Active released

What it is and what it does

office365-rest-python-client is a Python wrapper around Microsoft 365 and Microsoft Graph REST APIs. It provides two main entry points: ClientContext for SharePoint REST API v1 operations (lists, files, folders, permissions) and GraphClient for Microsoft Graph operations (Outlook, OneDrive, Teams, OneNote, Planner, users, groups). All authentication flows use Azure AD via the msal library, with support for certificate-based app-only access, interactive browser login, device code flow, and username/password delegation.

The library abstracts away REST call details, batching, and pagination. It handles common patterns like bulk item creation, filtering, selecting fields, and expanding related objects through a fluent query interface. It supports multiple Azure environments (Global, US Government variants, China, Germany) and is actively maintained with recent releases and community sponsorship options available.

Use it for:

  • Automate SharePoint list operations: bulk-create items, query with filters, manage permissions and folders programmatically.
  • Build integrations with Outlook, OneDrive, or Teams using Microsoft Graph without writing raw HTTP requests.
  • Migrate legacy SAML-based SharePoint automation to modern Azure AD certificate-based authentication.
  • Sync data between SharePoint lists and external systems via scheduled Python scripts.
  • Manage Microsoft 365 users, groups, and organizational structure through Graph API.
  • Upload, download, and organize files in SharePoint document libraries and OneDrive.

Worth the install?

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

Python client library for Microsoft 365 and Microsoft Graph APIs, covering SharePoint REST API v1, Outlook, OneDrive, Teams, OneNote, Planner, and modern Azure AD authentication flows.

Yes. The library is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. It covers a large surface of Microsoft 365 APIs with modern authentication and is widely used (top 5000 PyPI packages). Install it if you need to automate SharePoint, Outlook, Teams, or OneDrive operations from Python.

Install

office365-rest-python-client on PyPI

pip

pip install office365-rest-python-client

uv

uv add office365-rest-python-client

poetry

poetry add office365-rest-python-client

Installing office365-rest-python-client

Before you install

Low install friction with a pure-Python wheel. Actively maintained with a release 12 days ago and 1716 GitHub stars. Depends on msal, pytz, requests, and typing-extensions—all stable, widely-used libraries.

License in practice

MIT license permits unrestricted use, modification, and distribution in commercial and private projects with only attribution required.

Quickstart

pip install office365-rest-python-client

from office365.sharepoint.client_context import ClientContext

ctx = ClientContext("{site_url}").with_client_certificate(
    tenant="{tenant}", client_id="{client_id}",
    thumbprint="{thumbprint}", cert_path="./cert.pem"
)
web = ctx.web.get().execute_query()
print(f"Site title: {web.title}")

Requires Python 3.8 or later. Azure AD credentials (tenant, client_id, and certificate or secret) must be configured before authentication.

Verify before relying

  • Whether the library handles pagination and throttling transparently for large result sets beyond the 5000-row threshold mentioned in examples.
  • Current API coverage breadth across all Microsoft Graph endpoints (OneNote, Planner, etc.) and any known gaps.
  • Performance characteristics and memory usage when working with large files or bulk operations.

Package facts

License The MIT License (MIT) Copyright (c) 2016 Vadim Gremyachev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.8.0)
Install friction low — pure-Python wheel
Runtime dependencies 4 — msal, pytz, requests, typing-extensions
Maintenance actively maintained — 12 days since the last release
Last repo commit
First released
Downloads 17,285,720/month — #1,124 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: office365_rest_python_client-3.0.0-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries

Tags

microsoft 365 python clientsharepoint rest api pythonmicrosoft graph python libraryazure ad authentication pythonoffice 365 api wrapperteams outlook onedrive pythonsharepoint list items python
microsoft-365rest-api-clientazure-ad

More Libraries packages