Skip to main content

Sharepoint API

Install

pip install sharepoint-api

Setup Config

Create config.yaml

TENANT_NAME: ""
SITE_NAME: ""
CLIENT_ID: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxx"
CLIENT_SECRET: ""
LIBRARY_NAME: "Shared Documents"

Currently I am using Sharepoint "Shared Documents" area
If you needs to change -> Change in YAML file

LIBRARY_NAME: ""

Examples:

from sharepoint_api import SharePoint


sharepoint = SharePoint(config_path='config.yaml')
sp_path = "Myfiles/temp"
folder = sharepoint.get_folder(sp_path)
print(f"Folder: {folder}")
files, subfolders = sharepoint.list_folder_items()
print(files, subfolders)

# Download file
sharepoint.download_file(sp_path="Myfiles/temp/exam_result_v1.csv", local_file_path="/home/user/myfiles")

# Delete File
sharepoint.delete_file("MyFiles/models/yolo11n-obb.pt")

# Get file metadata
file_metadata = sharepoint.get_file_metadata("MyFiles/videos/sample_video.mp4")
print(f"File Metadata: {file_metadata.properties}")

# Upload File
sharepoint.upload_file("sample/exam_result_v1.csv", "Myfiles/temp/upload_test")

# Download Folder
sharepoint.download_folder(sp_path="Myfiles/temp/test1", local_file_path="/home/user/myfiles/sample")

# Create Folder
sharepoint.create_folder("Myfiles/temp/test2")

# Delete Folder
sharepoint.delete_folder("Myfiles/temp/test2")

# Upload Folder
sharepoint.upload_folder("sample/test", "Myfiles/gallery")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sharepoint_api-1.4.1.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file sharepoint_api-1.4.1.tar.gz.

File metadata

  • Download URL: sharepoint_api-1.4.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for sharepoint_api-1.4.1.tar.gz
Algorithm Hash digest
SHA256 11f372aabe363606413df8779aa9c1f2c72027ab896a1cc8926132bf7e7f6463
MD5 97e7a1b78b563792e75e6b7eed1f379d
BLAKE2b-256 e6e945e43623c7de692d7a7cd6340286c18d689283a67439c6ec045e4f83511e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.1 This release

1 file

1.4.0

1 file

1.3.6

1 file

1.3.5

1 file

1.3.4

1 file

1.3.3

1 file

1.3.2

1 file

1.3.1

1 file

1.3

1 file

1.2

1 file

1.1

1 file

1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page