sharepy
Simple SharePoint Online authentication for Python
What it is and what it does
SharePy is a thin wrapper around the Requests library that automates authentication to SharePoint Online and O365 sites. It handles the Microsoft security token flow, manages access cookies, and automatically refreshes digest tokens needed for API modifications. The package exposes a session object with familiar Requests methods (get, post, etc.) so developers can make HTTP calls to the SharePoint REST API without manually managing authentication headers or token lifecycle.
The package is designed for straightforward scripting and automation tasks—connecting to a SharePoint site, fetching lists or libraries, downloading files, and making modifications through the REST API. It supports both standard SharePoint Online and ADFS-enabled sites, and can persist authenticated sessions to disk to avoid re-authenticating on each run.
Use it for:
- Automate document downloads from SharePoint libraries on a schedule or in response to events.
- Query SharePoint lists and retrieve data for reporting or data pipeline tasks.
- Programmatically upload or modify SharePoint content without manual intervention.
- Build internal tools that need read/write access to O365 SharePoint sites.
- Integrate SharePoint data into Python data processing or ETL workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Handles authentication to SharePoint Online and constructs authenticated HTTP requests to the SharePoint REST API, extending the Requests library with session management and token refresh.
Yes, if you need to automate SharePoint Online access and can accept dormant maintenance. The package is stable and has no known vulnerabilities, but GPLv3 copyleft and high install friction (source-only) are real constraints. Evaluate whether the lack of updates since 2023 poses a risk for your authentication flow or Microsoft API compatibility before committing.
Install
sharepy on PyPI
pip
pip install sharepyuv
uv add sharepypoetry
poetry add sharepyInstalling sharepy
Before you install
High install friction due to source-only distribution (no wheels). Dormant maintenance—last release February 2022, no commits since September 2023—means bug fixes and compatibility updates are unlikely.
License in practice
GPLv3 copyleft license requires any derivative work to be released under the same license; suitable for internal tools and open-source projects, but incompatible with proprietary closed-source software.
Quickstart
import sharepy
s = sharepy.connect("example.sharepoint.com")
r = s.get("https://example.sharepoint.com/_api/web/lists/GetByTitle('Test Library')")
Requires Python 3.6 or later; interactive authentication prompts for username and password unless provided as arguments.
Verify before relying
- Whether the package works with current Microsoft authentication endpoints and token formats.
- Compatibility with recent versions of the Requests library it extends.
- Whether ADFS authentication support remains functional with modern Active Directory configurations.
Package facts
| License | GPLv3 (copyleft) |
| Python support | supports the current Python release (>=3.6, <4) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 1,651 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 811,607/month — #5,002 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sharepy-2.0.0.tar.gz
Keywords: sharepoint, online, authentication
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
SharePlumSharePlum provides a Python interface to…
permissive · top 5,000 on PyPI
office365-rest-python-clientPython client library for Microsoft 365 and…
permissive · top 5,000 on PyPI
o365O365 provides a Pythonic interface to Microsoft…
permissive · top 5,000 on PyPI
requests-kerberosAdds Kerberos/GSSAPI authentication support to…
permissive · top 5,000 on PyPI
pyodatapyodata is a Python client library that…
permissive · top 15,000 on PyPI
office365Wraps the O365 library to provide a…
permissive · top 15,000 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
vonage-http-clientProvides a synchronous HTTP client for…
permissive · top 15,000 on PyPI
Flask-HTTPAuthAdds HTTP Basic, Digest, and Token…
permissive · top 5,000 on PyPI
requests-gssapiAdds GSSAPI/Kerberos authentication support to…
permissive · top 15,000 on PyPI