msgraphfs
What it is and what it does
msgraphfs is a Python filesystem implementation that bridges Microsoft Graph API (SharePoint and OneDrive) with fsspec, the standard filesystem abstraction layer in the Python data ecosystem. It registers three custom protocols—msgd://, sharepoint://, and onedrive://—allowing you to read and write files on Microsoft 365 services through fsspec-compatible libraries.
The package handles OAuth2 token management, site and drive discovery, and permission queries automatically. It supports both single-site mode (where you specify the site and drive once in configuration) and multi-site mode (where you embed site and drive names in the URL). Authentication uses Azure AD application credentials via the client credentials flow, suitable for server-to-server scenarios. It requires Python >=3.10 and depends on authlib, fsspec, and httpx.
Use it for:
- Access files from SharePoint document libraries or OneDrive through fsspec-compatible tools without downloading locally first.
- Build ETL pipelines that read from and write to OneDrive or SharePoint using server-to-server authentication.
- List files with metadata and permission details from SharePoint sites programmatically for audit workflows.
- Process multiple files in parallel using fsspec-compatible libraries by reading from SharePoint URLs with wildcard patterns.
- Integrate Microsoft 365 storage with data processing workflows that already use fsspec.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a filesystem interface to Microsoft Graph API drives (SharePoint and OneDrive) via fsspec, enabling integration with fsspec-compatible data processing libraries.
Yes, if you need to integrate SharePoint or OneDrive into Python workflows using fsspec. The package is actively maintained, has low install friction, carries a permissive MIT license, and fills a clear gap for fsspec users working with Microsoft 365. Verify that your Azure AD setup and API permissions are in place before installation, and confirm that Python >=3.10 is available.
Install
msgraphfs on PyPI
pip
pip install msgraphfsuv
uv add msgraphfspoetry
poetry add msgraphfsInstalling msgraphfs
Before you install
Low install friction with a pure-Python wheel and only three runtime dependencies (authlib, fsspec, httpx). Active maintenance with a recent commit on 2026-08-10 and releases within the past year.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the copyright notice and license text.
Quickstart
pip install msgraphfs
import fsspec
storage_options = {
'client_id': 'your-client-id',
'tenant_id': 'your-tenant-id',
'client_secret': 'your-client-secret',
'site_name': 'YourSite',
'drive_name': 'Documents'
}
fs = fsspec.filesystem('msgd', **storage_options)
files = fs.ls('/folder')
Requires Python >=3.10; Azure AD application credentials (client_id, tenant_id, client_secret) and appropriate API permissions configured in Azure Portal.
Verify before relying
- Whether the package handles concurrent access safely in multi-threaded environments beyond fork-safe lazy initialization.
- Performance characteristics and limitations when working with large files or high-volume directory listings.
- Specific error handling and retry behavior for transient network or authentication failures.
- Full scope of file operations supported (read, write, delete, rename) and any restrictions on each.
Package facts
| License | The MIT License (MIT) Copyright (c) 2024 Laurent Mignon (ACSONE) 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.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — authlib, fsspec, httpx |
| Maintenance | actively maintained — 43 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,712,760/month — #2,247 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: msgraphfs-0.5-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
adlfsProvides a filesystem interface to Azure Blob…
permissive · top 5,000 on PyPI
azureml-fsspecProvides a filesystem interface to Azure…
unclear · top 15,000 on PyPI
gdrive-fsspecProvides a fsspec-compatible filesystem…
permissive · top 15,000 on PyPI
msgraph-sdkPython client library for calling Microsoft…
permissive · top 5,000 on PyPI
webdav4A WebDAV client library that provides a Python…
permissive · top 15,000 on PyPI
o365O365 provides a Pythonic interface to Microsoft…
permissive · top 5,000 on PyPI
office365-rest-python-clientPython client library for Microsoft 365 and…
permissive · top 5,000 on PyPI
ocifsProvides a fsspec-compatible filesystem…
unclear · top 15,000 on PyPI
sshfsProvides an fsspec-compatible filesystem…
permissive · top 5,000 on PyPI
fsspecfsspec provides a unified filesystem interface…
unclear · top 100 on PyPI