A large release centered on data import/export, large-list reliability, and the SharePoint Migration API.
✨ Highlights
- Typed CAML query builder — compose
ViewXmlin Python instead of raw strings:Caml.text("Status").eq("Active"),Caml.lookup("Category").id().in_([2, 3]), binary-nested.and_()/.or_()/.not_(), pluswhere/order_by/group_by/view_fields. - Streaming import driver —
ImportResultqueues, executes and discards chunks (bounded memory) with checkpoints (resume interrupted runs), live progress, dead-lettering, and keyed skip/upsert so re-runs never duplicate rows. - Migration API toolkit —
office365.migration.package(manifest/export XML,PackageBuilder, AES-256-CBC staging,SharePointPackageTarget) and SPMT-styleMigrationSession/MigrationServerJobwith server-side provisioning and progress. Document-library subset. - Locked files (HTTP 423) — typed
FileLockedException(.lock_owner,.GUIDANCE) andSPFileCheckOutException, opt-in retry withretry_on(FileLockedException), andbypass_shared_lock=True. - Large-list fixes — paging for
Folder.get_filesandList.get_items(page_size=...),List.ensure_indexed()(the real fix for #427), typedSPQueryThrottledException, and a one-time warning at the 5,000-item threshold. Seedocs/large-lists.md. - Locale-independent errors — classification keyed on HRESULT / the embedded .NET type instead of translated text, plus a full SharePoint exception taxonomy (
SPFileCheckOutException,SPListDataValidationException, …). - Idempotent provisioning —
DriveItem.ensure_file(), the sharedget_or_createhelper, andensure_*(on_conflict="skip"|"update")across fields, lists and content types.
⚠️ Breaking changes
- Data-pipeline naming:
from_*is now the streaming entry (returnsImportResult);queue_*is the deferred queue-all path. Removedimport_*andto_json_file/from_json_file(useexport_to(..., format="json")/from_json);FieldCollection.from_dataframe→ensure_from_dataframe. List.from_dataframe()returns anImportResultdriver (wasList);progressis keyword-only.MigrationOptions.preserve_timestampsnow defaults toFalse, and requesting fidelity an adapter pair can't honor raisesNotImplementedErrorinstead of silently doing nothing.ensure_*helpers now return the ensured entity/entities.
🐛 Notable fixes
- Custom transport sessions carrying their own auth handler work again (NTLM/SSPI, #1045); on-prem
allow_ntlm=Truefixed. - 49 collection-bound OData methods were removed from 24 item types (e.g.
User.remove_by_id). $skippaging no longer collides with a server$skiptoken.- Migration packages now emit the manifest files the API fetches;
CreateMigrationJobEncryptedsends the key as base64. - DataFrame imports no longer drop columns that collide with built-in SharePoint fields (
Name→FileLeafRef).
📄 Full changelog: CHANGELOG.md · 📦 pip install --upgrade office365-rest-python-client