This repository provides a set of tools and scripts designed to interact with Microsoft SharePoint to manage and process documents. Utilizing Python, this project simplifies tasks such as retrieving, managing, and processing documents stored in SharePoint.
You can read the full article
- Retrieve site and drive IDs from SharePoint
- List contents of a folder in SharePoint
- Download files and folders from SharePoint
- Process various types of documents (PDF, DOCX, PPTX, CSV, TXT)
- Use custom loaders for handling different file formats
- Integration with Python's
dotenv
package for environment management
Before you begin, ensure you have the following:
- Python 3.11 or higher
- Access to a Microsoft SharePoint instance
- Client credentials for accessing Microsoft Graph API
- Clone the repository:
git clone https://github.com/ericvaillancourt/LangChain_SharePointLoader
- Navigate to the cloned directory:
cd LangChain_SharePointLoader
- Install required packages:
pip install -r requirements.txt
- Create a
.env
file in the root directory of your project. - Add the following environment variables:
TENANT_ID=your_tenant_id CLIENT_ID=your_client_id CLIENT_SECRET=your_client_secret SITE_URL=your_site_url RESOURCE=your_resource_url
- Replace
your_tenant_id
,your_client_id
,your_client_secret
,your_site_url
, andyour_resource_url
with your actual SharePoint and Microsoft Graph credentials.
To start using this tool with SharePoint:
-
Run the main script to interact with SharePoint:
python main.py
This will perform operations defined in the script, such as listing folder contents and downloading files.
-
Check the output in the console for results of operations such as retrieving site ID, drive information, and document processing.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.