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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ms365sync-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 9d9ccb7acc74b3cb7c76e697e9f266ae792f999a962f69846a0a642d7288d722
MD5 94ac59d35936f7d111e4f409634fb199
BLAKE2b-256 75befdd2d490a2f0872bec81e02df64c4869eedbccf2cdab38c0f06bfde733ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ms365sync-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 169b1af69e43989a842c756197de4e83f49407568d198645bed3f76959d0827c
MD5 ffc7ebac0a184f544ede032da988029a
BLAKE2b-256 2cbbcb6ef7be3254cffe872cb81dfeefb452b114731f89a04f71a7efd7ea3eea

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