Skip to main content

Microsoft SharePoint client package powered by Rust and PyO3.

Project description

sharepointlib

Microsoft SharePoint client package for Python powered by Rust.

Installation

pip install sharepointlib

Usage

import sharepointlib

sharepoint = sharepointlib.SharePoint(
    client_id="<client-id>",
    tenant_id="<tenant-id>",
    client_secret="<client-secret>",
    sp_domain="companygroup.sharepoint.com",
)
# Site metadata
response = sharepoint.get_site_info(name="My Site")
if response.status_code == 200:
    print(response.content)
# Drives
response = sharepoint.list_drives(site_id="companygroup.sharepoint.com,abc,def")
if response.status_code == 200:
    print(response.content)
# List a folder
response = sharepoint.list_dir(
    drive_id="b!123",
    path="Sellout/Support",
    alias=r"_\d{8}",
)
if response.status_code == 200:
    print(response.content)
# Download one file
response = sharepoint.download_file(
    drive_id="b!123",
    remote_path="Sellout/Support/report.xlsx",
    local_path=r"C:\\Temp\\report.xlsx",
)
print(response.status_code)
# Download to memory (bytes)
response = sharepoint.download_file_to_memory(
    drive_id="b!123",
    remote_path="Sellout/Support/report.xlsx",
)
if response.status_code == 200:
    payload_bytes = response.content
    print(len(payload_bytes))
# Copy across drives via streaming
response = sharepoint.copy_file_stream(
    source_drive_id="b!SRC",
    source_path="Sellout/2024/Sellout_November.xlsx",
    target_drive_id="b!DST",
    target_path="Archive/2024",
    new_name="Sellout_November_2024_Backup.xlsx",
    timeout=7200,
)
print(response.status_code)
# SharePoint lists
response = sharepoint.list_lists(site_id="companygroup.sharepoint.com,abc,def")
if response.status_code == 200:
    print(response.content)

For technical and contributor documentation, see DEV.md.

Version

Recommended way to read installed package version:

from importlib.metadata import version

print(version("sharepointlib"))

Convenience attribute:

import sharepointlib

print(sharepointlib.__version__)

Licence

BSD-3-Clause Licence (see LICENSE)

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

sharepointlib-0.1.4.tar.gz (40.5 kB view details)

Uploaded Source

Built Distributions

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

sharepointlib-0.1.4-cp310-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

sharepointlib-0.1.4-cp310-abi3-manylinux_2_39_aarch64.whl (2.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.39+ ARM64

sharepointlib-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

sharepointlib-0.1.4-cp310-abi3-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file sharepointlib-0.1.4.tar.gz.

File metadata

  • Download URL: sharepointlib-0.1.4.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sharepointlib-0.1.4.tar.gz
Algorithm Hash digest
SHA256 73fb9a31b75b0f179b8cb7284436cdaa0910804521d58758f840d752b5cf135b
MD5 6c875e292f7ad51215865c4c9a63111d
BLAKE2b-256 8599fac79f68099ee8f9f680da84100bc54dadc943d0d70c265d28eb307c6872

See more details on using hashes here.

File details

Details for the file sharepointlib-0.1.4-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for sharepointlib-0.1.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a1164fb94138b16e603f040f5f8dfc467730c90a1ee63e1cb6245ea1c2a63337
MD5 1d53a31aa5c725ba3e3c676d1f90f5cf
BLAKE2b-256 a1bb0938acad2b4302564bbe1effe11d9d7839b9fbcbfd65ccadd3b135cb3c16

See more details on using hashes here.

File details

Details for the file sharepointlib-0.1.4-cp310-abi3-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for sharepointlib-0.1.4-cp310-abi3-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 b41bbb1ccc737ba50062bcf0e4b3304215072b3839ca395143f205f9dbedf178
MD5 426b6666cdda68529df4071cfd8e6fcb
BLAKE2b-256 9e2b8ed74bcd24a668cd69ef875852ec540afb922b3b8da81c1bc05d091a0112

See more details on using hashes here.

File details

Details for the file sharepointlib-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sharepointlib-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f63dd2cfdf1e4f0b4ba337fa648994e7f10635a9277c56f37d165f682912baa7
MD5 de82d958c85a32e6dcaacc217727a0dc
BLAKE2b-256 9367a06228a578dc32b1e913ee93c6e3e5ac64bda8521edf436ba6b24aa17f09

See more details on using hashes here.

File details

Details for the file sharepointlib-0.1.4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sharepointlib-0.1.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fdf76b7b7ffb36d8f4ccabe11fc17c6e624d59a5e706e05fc2182d78977dc32b
MD5 083fcec58a9e0988b16fa6b099ab8f25
BLAKE2b-256 fdf087a6243b908c1b5d7672cdfa4441cf888d50b6561fa761e817d203cea556

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