Skip to main content

A SharePoint file management tool for python programs.

Project description

Simple SharePoint

This package is designed to be a simple code interface to manage files in a SharePoint account.

How to Install

pip install simple_sharepoint

How to Use

import os
from py_simple_sharepoint import SharePoint

sp = SharePoint(
    user=os.getenv('USERNAME'),
    password=os.getenv('PASSWORD'),
    sharepoint_url="https://example.com/sites/YourSite",
    library_title="Main Folder"
)

sp_path = 'Folder 1/Subfolder'
# Create a directory in SharePoint
sp.create_directory(sp_path, 'New Folder')

# Upload a file to SharePoint
sp.upload_file(r'/path/to/file.txt', sp_path)

# get file objects from a directory
files = sp.get_files(sp_path)
for file in files:
    sp.download_file(file)
    sp.move_file(file, sp_path + '/Archive')
    sp.delete_file(file)

# get folder by link
folder = sp.get_folder_by_link(r'/sites/YourSite/Shared Documents/' + sp_path)
files = sp.get_files(folder)
for file in files:
    print(f'Moving file to archive: {file.properties["Name"]}')

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

py_simple_sharepoint-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_simple_sharepoint-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file py_simple_sharepoint-0.1.1.tar.gz.

File metadata

  • Download URL: py_simple_sharepoint-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for py_simple_sharepoint-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1208bdc1b04be4c1f6586ca859f504f5c0654aa1ee404114df84ef1f93aa7172
MD5 00437ec80080c8707684296827484c42
BLAKE2b-256 684bc7c30ed1b4626c45e490eaec370ab2a56e6dc9da92db0f4e2962c70dd183

See more details on using hashes here.

File details

Details for the file py_simple_sharepoint-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_simple_sharepoint-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29b5e38f8376b5185af11ce89e3fe37f62e6d8d287da14a4e8b4b61045cc4a13
MD5 4f00178dff4d124c3b366369277c0e0a
BLAKE2b-256 9f461f783071bb875a73db7cd17c95bd108013ddab3f28deca8d3eff0cb2ed3e

See more details on using hashes here.

Supported by

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