You will find example on connecting to Office 365 SharePoint using the Office 365 Rest Python Client package.
To run this project, you will need to add the following environment variables to your .env file
sharepoint_email
sharepoint_password
sharepoint_url_site
sharepoint_site_name
sharepoint_doc_library
Create Virtual Environment
python -m venv env
Activate Environment
source env/Scripts/activate
Install Packages
pip install -r requirements.txt
Install Office365 API Package Directly from Github
pip install git+https://github.com/vgrem/Office365-REST-Python-Client.git#egg=Office365-REST-Python-Client