Skip to main content

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

  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?

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.2.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ms365sync-0.3.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file ms365sync-0.3.2.tar.gz.

File metadata

  • Download URL: ms365sync-0.3.2.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ms365sync-0.3.2.tar.gz
Algorithm Hash digest
SHA256 1aa2a5f02dd8fdda075ce13f7531c22d7b0b4c55a7c7083465eefb336c969e56
MD5 ccb21a2db8934ce71dc7a89fdef931e9
BLAKE2b-256 8605dce674969e468aaff77992c0f21840467005e573f032d650f143e5eb3994

See more details on using hashes here.

File details

Details for the file ms365sync-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ms365sync-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ms365sync-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9909e7d09abf30c7d57f5585e2f47acd9f3d69e159053ece3ceadac5c1138dec
MD5 c1ad8da6d26508a250fe9b2eb00c3616
BLAKE2b-256 6cf570e5b0d66e2ad03510368a7282a9938a081148aede806d40b8554a92a208

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page