A library to read SharePoint lists into pandas DataFrames.
Project description
Ah, got it! If your package is available on PyPI and can be installed via pip
, here's how you can include usage instructions in your README.md
file for users who install the package through pip
.
README.md
# SharePoint to DataFrame
This library provides a function to read SharePoint lists into pandas DataFrames.
## Installation
You can install the package from PyPI using pip:
```sh
pip install sharepoint-to-dataframe
Usage
Function: get_list_view
This function retrieves data from a SharePoint list and loads it into a pandas DataFrame.
Importing the Function
First, import the function from the installed package:
from sharepoint_to_dataframe import get_list_view
Calling the Function
To call the function, use the following syntax:
import pandas as pd
from sharepoint_to_dataframe import get_list_view
# Define your parameters
username = 'your_username'
password = 'your_password'
sharepoint_site = 'https://yourcompany.sharepoint.com/sites/yoursite'
list_name = 'Your List Name'
view_name = 'Your View Name' # Optional: Default is "All Items"
# Call the function
df = get_list_view(username, password, sharepoint_site, list_name, view_name)
# Print the DataFrame
print(df)
Parameters
username
(str): Your SharePoint username.password
(str): Your SharePoint password.sharepoint_site
(str): The URL of your SharePoint site.list_name
(str): The name of the SharePoint list you want to access.view_name
(str, optional): The name of the view within the list. Defaults to"All Items"
.
Returns
DataFrame
: A pandas DataFrame containing the data from the SharePoint list view.
Example
Here's a complete example demonstrating how to use the get_list_view
function:
import pandas as pd
from sharepoint_to_dataframe import get_list_view
# Define your parameters
username = 'john.doe@example.com'
password = 'your_password'
sharepoint_site = 'https://example.sharepoint.com/sites/testsite'
list_name = 'Employee List'
view_name = 'Active Employees'
# Retrieve the DataFrame
df = get_list_view(username, password, sharepoint_site, list_name, view_name)
# Display the DataFrame
print(df)
This example fetches data from the "Active Employees" view of the "Employee List" on the specified SharePoint site and prints it as a pandas DataFrame.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
For any issues or questions, please contact Mutaz Younes at mutazyounes@gmail.com.
### Key Points
1. **Installation Instructions**: Use `pip` to install the package from PyPI.
2. **Function Import and Usage**: How to import the function and use it.
3. **Parameters and Return Values**: Detailed descriptions of function parameters and return values.
4. **Example Usage**: A full example to demonstrate how to call the function and use it.
This should help users understand how to install and use your library after installing it via `pip`.
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
Built Distribution
Hashes for sharepoint_to_df-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca822c7652c5f33e6cc5a4a56027abc1aa0f36a172b26d3a57f6bee2c2ad84bb |
|
MD5 | 14eab07aff590abd9e60613a99031ac9 |
|
BLAKE2b-256 | d1b4695f7b65d57909fff37f8c0b0cc1644e43ae07f498b5cfe9a971574e3f2f |