A Python library for syncing files between Microsoft 365 SharePoint and local storage
Project description
MS365Sync
Sync files between Microsoft 365 SharePoint and your local machine with permission tracking.
What it does
- Downloads files from SharePoint document libraries to local folders
- Tracks file permissions and detects changes
- Syncs only when files are modified (smart sync)
- Works via command line or Python code
Quick Start
1. Install
pip install ms365sync
2. Setup Azure App
- Go to Azure Portal → Azure Active Directory → App registrations
- Create new app registration
- Add these API permissions:
Sites.Read.All,Files.Read.All(Application permissions) - Create a client secret
- Grant admin consent
3. Configure
Create a .env file:
TENANT_ID=your-azure-tenant-id
CLIENT_ID=your-azure-client-id
CLIENT_SECRET=your-azure-client-secret
4. Use it
Command line:
ms365sync \
--sharepoint-host "yourcompany.sharepoint.com" \
--site-name "Your Site Name" \
--doc-library "Documents"
Python code:
from ms365sync import SharePointSync
sync = SharePointSync(
sharepoint_host="yourcompany.sharepoint.com",
site_name="Your Site Name",
doc_library="Documents"
)
changes = sync.sync()
print(f"Synced {changes['total_files']} files")
What you get
After running sync:
├── data/ # Your SharePoint files
└── .permissions.json # Permission tracking
sync_logs/ # Sync operation logs
Need help?
- Check the
examples/folder for more usage patterns - Report issues: GitHub Issues
- Email: aiteam@phianalytica.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ms365sync-0.3.4.tar.gz
(18.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ms365sync-0.3.4-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file ms365sync-0.3.4.tar.gz.
File metadata
- Download URL: ms365sync-0.3.4.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70ced71a92e9dc3af716f2582c6589533fd8eaed37b94d27e5c747798fcc8c55
|
|
| MD5 |
aadc7f6f3b4f77b29a1cc6393159a4a0
|
|
| BLAKE2b-256 |
22973b7c7a31b067f530c4b733550563f4243a38cb11789ef53a48a64768808e
|
File details
Details for the file ms365sync-0.3.4-py3-none-any.whl.
File metadata
- Download URL: ms365sync-0.3.4-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9376e2db7a4c493dbedef3ac38c15a281330829f8a6b6790422e2a9c8ad1fa24
|
|
| MD5 |
933524ea9596cfa3931a4817f2b58822
|
|
| BLAKE2b-256 |
9e9c0702290088a8611c2815e1abebe5992e7e6fd58552553b75fcbee491bed5
|