Utility functions for working with SharePoint
Project description
SharePoint Utility
The SharePoint Utility is a Python package designed to simplify the process of working with files and folders in SharePoint. It provides a set of utility functions that allow you to connect to SharePoint, read and upload files, and perform various operations on files and folders.
Installation
To install the SharePoint Utility package, use the following pip command in your terminal:
!pip install sharepoint-utils
Usage
The SharePoint Utility package provides several functions for connecting to SharePoint, reading and uploading files, and working with files and folders.
Available Functions
# Functions for establishing a connection, reading files, and uploading files.
from sharepoint_utils import read_file_from_different_library
from sharepoint_utils import read_file_from_default_library
from sharepoint_utils import combine_files_into_dataframe
from sharepoint_utils import copy_files_within_folders
from sharepoint_utils import upload_dataframe_as_csv
from sharepoint_utils import connect_to_sharepoint
from sharepoint_utils import get_folder_url
from sharepoint_utils import get_file_path
Usage Examples
# Establish a connection to SharePoint.
sharepoint_ctx = connect_to_sharepoint('your_username', 'your_password', 'https://your_sharepoint_site_url')
# Combine files into a DataFrame.
folder_path = 'relative/folder/path'
df = combine_files_into_dataframe(sharepoint_ctx, folder_path)
# Upload a DataFrame to a SharePoint folder as a CSV file.
folder_path = '/folder_path/'
upload_dataframe_as_csv(ctx, folder, df, 'your_file_name.csv')
# Retrieve SharePoint folder URLs as a list.
folder_urls = get_folder_url(sharepoint_ctx, document_library_relative_url)
print(folder_urls)
# Retrieve SharePoint file paths as a list.
file_paths = get_file_path(sharepoint_ctx, subfolder_urls_files)
print(file_paths)
# Copy files from one folder to another within the SharePoint site.
copy_files_within_folders(ctx, filepath , files_upload_to_path)
Contributing
Contributions to the SharePoint Utility package are always welcome! If you have any suggestions for improvements or if you encounter any issues while using the package, please feel free to contact me. Your feedback and contributions will help make this package even better and more useful for everyone.
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
Built Distribution
Hashes for sharepoint_utils-2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2944899d69fcf7fca9fdd795044b6f0ce3c3deba2ae360f9d96b875d719a6dc0 |
|
MD5 | 601a590013b972884dfe15db87c00f27 |
|
BLAKE2b-256 | 30383a25334824f61e86ad40a1eb5f853327404bc7b229b829fd9de24411536b |