Skip to main content

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

  1. Go to Azure Portal → Azure Active Directory → App registrations
  2. Create new app registration
  3. Add these API permissions: Sites.Read.All, Files.Read.All (Application permissions)
  4. Create a client secret
  5. 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?

Metadata

Release files for ms365sync 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ms365sync 0.3.4
File Size Uploaded
ms365sync-0.3.4.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ms365sync 0.3.4
File Interpreter ABI Platform
ms365sync-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / ms365sync-0.3.4.tar.gz

Download URL ms365sync-0.3.4.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
70ced71a92e9dc3af716f2582c6589533fd8eaed37b94d27e5c747798fcc8c55
BLAKE2b-256 checksum
How to use checksums
22973b7c7a31b067f530c4b733550563f4243a38cb11789ef53a48a64768808e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / ms365sync-0.3.4-py3-none-any.whl

Download URL ms365sync-0.3.4-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9376e2db7a4c493dbedef3ac38c15a281330829f8a6b6790422e2a9c8ad1fa24
BLAKE2b-256 checksum
How to use checksums
9e9c0702290088a8611c2815e1abebe5992e7e6fd58552553b75fcbee491bed5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page