1 Star 0 Fork 0

Anesthesia丶 / Sharepoint Tool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.en.md 3.11 KB
一键复制 编辑 原始数据 按行查看 历史
Anesthesia丶 提交于 2023-10-18 14:55 . update README.en.md.

Sharepoint Tool

Introduction

A tool that can download and upload files from SharePoint. Instead of using the Graph API, cleverly manipulate files using playwright. One time login, with subsequent unattended calls as a batch. If you're interested, come and take a look~

CSDN Blog homepage: [https://blog.csdn.net/qq_36991535?spm=1000.2115.3001.5343](https://blog.csdn.net/qq_36991535?spm=1000.2115.3001.5343)

Environmental requirements

Python: 3.8.5 OS: Windows 10

Installation Tutorial

  1. pip install - r requirements.txt

Instructions for use

  1. Configure global.json file
{
  "chrome path": "C:   Program Files   Google   Chrome   Application   chrome. exe", # Google ChromeExe file path
  "user_data_dir":" user_data_dir ", # Browser cache directory, which can be a relative path or an absolute path
  "always_show": false, # Control whether the browser is always displayed
  "page_timeout": 30000, # Setting the timeout time for screen loading in ms
  "login timeout": 300000, # Login timeout ms
  "win_size": "800,600", # Browser window size setting
  "win_posi": "0,0", # Browser location setting
  "base_url": "https://fujitsu.sharepoint.com/teams/msteams_d54409", # Path for sharepoint
  "login selector ":" #leftRegion ", # CSS selector for determining successful login
  "login_url": "https://www.office.com/?auth=2, # Login address settings, with the Office365 homepage as the login address, or any product of any 
Office365 as the login address
  "max_retry_count": 5, # Maximum retry count configuration
  "retry_interval": 5, # Configuration of retry interval s
  "output_folder": "output", # specifying the output path
  "proxy": "http://xxx.xxx.xxx.xxx:xxxx" # Proxy settings, specify null when no proxy is required
  "spo_folder":"/Application of electronic contracts", # Sharepoint path for storing files
  "filename": "20220330_1.PNG" # The file name in the sharepoint path
}
  1. Configuration file global.json after, you can directly execute the following commands

Python spo_file_download.py

Alternatively, you can start directly using parameter passing without using configuration, and note that only 'spo' is available_Folder and file_Name 'is a mandatory configuration

Priority command parameters>globalJSON configuration file

Example:

Python spo_file_download.py -- spo_folder="/Application of Electronic Contracts" --file_name="20220330_1. PNG"

  1. Use pyinstaller to package as exe

pyinstaller - F spo_File_download.py

Execution method and 2. the same.

Related technical documents

Playwright official website: [https://playwright.dev/python/docs/intro](https://playwright.dev/python/docs/intro)

Pyinstaller: [https://pypi.org/project/pyinstaller/](https://pypi.org/project/pyinstaller/)

Project highlights

  1. The browser can cache user login information, and the next boot can be downloaded without logging in. It can be executed on a scheduled basis or batch called

  2. Headless mode can be set, running in the background without affecting work

  3. Customizable browser

Python
1
https://gitee.com/zjw_xqb/sharepoint-tool.git
git@gitee.com:zjw_xqb/sharepoint-tool.git
zjw_xqb
sharepoint-tool
Sharepoint Tool
master

搜索帮助