shareplum is a Python library designed to simplify interaction with Microsoft SharePoint sites. It provides functionalities for managing files, lists, and users, supporting various SharePoint versions. As of version 0.5.1, the library is actively maintained with a focus on API stability, particularly for file operations.
pip install shareplumVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to connect to a SharePoint site using environment variables for credentials and retrieve a list of all available lists on the site. Highlights common issues and their troubleshooting.
Review the official `shareplum` documentation or GitHub examples for the updated Files API methods. Test file-related operations thoroughly after upgrading.
Consult your SharePoint administrator for the correct authentication method. shareplum primarily supports basic username/password; for more complex setups, you might need to handle authentication externally or use other tools like `MSAL.py` to obtain a bearer token, which `shareplum` can then use.
Double-check the exact SharePoint site URL in your browser. Ensure it includes any `/sites/` or `/teams/` segments if applicable to your site collection.
Always pass the appropriate `version` parameter to the `Site` constructor. For SharePoint Online (Office 365), `Version.v365` is typically correct.
Install the library using pip: `pip install shareplum`
Verify your username and password, check your SharePoint permissions, or correctly configure ADFS/SAML authentication using the `Auth` class with `adfs_url` if applicable.
First access the desired folder, then call the file operation method: `folder = site.Folder('Shared Documents'); folder.upload_file(file_content, 'my_file.txt')`You can disable SSL verification (not recommended for production) by passing `verify_ssl=False` to the `Site` constructor: `site = Site(sharepoint_url, version=Version.v365, authcookie=auth_cookie, verify_ssl=False)` or ensure your environment trusts the SharePoint server's certificate.