Skip to main content

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

sharepoint_utils-2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

sharepoint_utils-2.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file sharepoint_utils-2.0.tar.gz.

File metadata

  • Download URL: sharepoint_utils-2.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for sharepoint_utils-2.0.tar.gz
Algorithm Hash digest
SHA256 19d8334148fa0a93e65dfba43257e0363ac3901a7b82bb93c406e587e3bdd6b0
MD5 14e28e6932140df14fa72525cbd55096
BLAKE2b-256 7a801e5008dfee60782c7a5001d67ab633d30eeb7843aa1b269a43f8bc2fcdbd

See more details on using hashes here.

File details

Details for the file sharepoint_utils-2.0-py3-none-any.whl.

File metadata

  • Download URL: sharepoint_utils-2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for sharepoint_utils-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2944899d69fcf7fca9fdd795044b6f0ce3c3deba2ae360f9d96b875d719a6dc0
MD5 601a590013b972884dfe15db87c00f27
BLAKE2b-256 30383a25334824f61e86ad40a1eb5f853327404bc7b229b829fd9de24411536b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page