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")

Metadata

Release files for sharepoint-api 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sharepoint-api 1.4.1
File Size Uploaded
sharepoint_api-1.4.1.tar.gz 5.0 kB Details

Release files / sharepoint_api-1.4.1.tar.gz

Download URL sharepoint_api-1.4.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
11f372aabe363606413df8779aa9c1f2c72027ab896a1cc8926132bf7e7f6463
BLAKE2b-256 checksum
How to use checksums
e6e945e43623c7de692d7a7cd6340286c18d689283a67439c6ec045e4f83511e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

1.4.1 This release

1 release file

1.4.0

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release 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