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.3.tar.gz (18.6 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.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ms365sync-0.3.3.tar.gz
  • Upload date:
  • Size: 18.6 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.3.tar.gz
Algorithm Hash digest
SHA256 2b09e15bb13d9799431b61ed182783eba0dab57725f8f7a383c4bbfe54522cf7
MD5 9cd79751bdbf020a4cd095344aa53d63
BLAKE2b-256 b86328ccf971390613405702698943221b3be6e6ea0564358524a998ca965caa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ms365sync-0.3.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 95ca24bb3c162c1f66306d9933a838c896ae8503af1afa7ae1640f6085c718d8
MD5 eac26c2fc6c49632ecfc8663aa4ab82b
BLAKE2b-256 ad6877e2ee65b2008357c8b89adc8cceeb5444a3640576a98fa022d11be7bd04

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