Utility functions for working with SharePoint files
Project description
SharePoint Utility
This Python package provides utility functions for working with SharePoint files & folders.
Installation
!pip install sharepoint-utils
Usage
available functions
# functions for connection, reading and uploading files.
from sharepoint_utils import connect_to_sharepoint
from sharepoint_utils import upload_dataframe_to_sharepoint
from sharepoint_utils import read_file_from_sharepoint
# functions for reading files and folders.
from sharepoint_utils import combine_files_into_dataframe
from sharepoint_utils import get_folder_urls
from sharepoint_utils import get_file_paths
from sharepoint_utils import copy_files_within_folders
Usage Examples
# Create 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 DataFrame to SharePoint folder as a csv file
folder_path = '/folder_path/'
upload_dataframe_to_sharepoint(ctx, folder, df, 'your_file_name.csv')
# get sharepoint folder url as a list
folder_urls = get_folder_urls(sharepoint_ctx, document_library_relative_url)
print(folder_urls)
# get sharepoint file path as a list
file_paths = get_file_paths(sharepoint_ctx, subfolder_urls_files)
print(file_paths)
# copy files from one folder to another within sharepoint site
copy_files_within_folders(ctx, filepath , files_upload_to_path)
Contributing
Contributions are welcome! If you have any suggestions or find any issues, please feel free to contact me.
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
sharepoint_utils-1.1.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for sharepoint_utils-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 347ef9ea6e9bc68298a7ae2fdde4295547a7c7032ca68af0d9c32f44195497ef |
|
MD5 | 72564673ed8bc9faca5d9fb7ffa932f7 |
|
BLAKE2b-256 | e0e90cc412ef8fba6aab7b3bcfbe09a169849b4b5781bac5bb7bc227af12491e |