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.0.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.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ms365sync-0.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 7f7979b43e91f02d2269d2643eb0083dc041b81b4c9f169db5661c8246056b65
MD5 33e58470cd60814e5270e12e5fe5283e
BLAKE2b-256 a6c836973b136bc5d50486d879a73a8a5b95f28f8660b7a1b2e32dcf0a5ff755

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ms365sync-0.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea93267f61bdb823c478c20a4e411c223bb200617c4fbf2121971cf1b65d176e
MD5 e6f639e6870445afd6b4fe68402ba023
BLAKE2b-256 c0c8fee386d4feb1cd696f0f4573b0319073d5cd87a0e9ca90ce03b43efab5e4

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