Skip to content

Commit 81591c9

Browse files
committed
getting started
1 parent ce161bc commit 81591c9

File tree

4 files changed

+77
-1
lines changed

4 files changed

+77
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ df = spark.read.format("msgraph") \
8282
.load()
8383

8484
df.show()
85+
86+
# with schema
87+
88+
df = spark.read.format("msgraph") \
89+
.option("resource", "list_items") \
90+
.option("site-id", "<YOUR_SITE_ID>") \
91+
.option("list-id", "<YOUR_LIST_ID>") \
92+
.option("top", 100) \
93+
.option("expand", "fields") \
94+
.schema("id string, Title string")
95+
.load()
96+
97+
df.show()
98+
8599
```
86100

87101
---

docs/getting-started.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Installation
2+
3+
```bash
4+
pip install pyspark-msgraph-source
5+
```
6+
7+
---
8+
9+
### 1. Authentication
10+
11+
This package uses [DefaultAzureCredential](https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#defaultazurecredential).
12+
Ensure you're authenticated:
13+
14+
```bash
15+
az login
16+
```
17+
18+
Or set environment variables:
19+
```bash
20+
export AZURE_CLIENT_ID=<your-client-id>
21+
export AZURE_TENANT_ID=<your-tenant-id>
22+
export AZURE_CLIENT_SECRET=<your-client-secret>
23+
```
24+
25+
### 2. Example Usage
26+
27+
```python
28+
from pyspark.sql import SparkSession
29+
30+
spark = SparkSession.builder \
31+
.appName("MSGraphExample") \
32+
.getOrCreate()
33+
34+
from pyspark_msgraph_source.core.source import MSGraphDataSource
35+
spark.dataSource.register(MSGraphDataSource)
36+
37+
df = spark.read.format("msgraph") \
38+
.option("resource", "list_items") \
39+
.option("site-id", "<YOUR_SITE_ID>") \
40+
.option("list-id", "<YOUR_LIST_ID>") \
41+
.option("top", 100) \
42+
.option("expand", "fields") \
43+
.load()
44+
45+
df.show()
46+
47+
# with schema
48+
49+
df = spark.read.format("msgraph") \
50+
.option("resource", "list_items") \
51+
.option("site-id", "<YOUR_SITE_ID>") \
52+
.option("list-id", "<YOUR_LIST_ID>") \
53+
.option("top", 100) \
54+
.option("expand", "fields") \
55+
.schema("id string, Title string")
56+
.load()
57+
58+
df.show()
59+
60+
61+
```

docs/guides/list-items.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This guide explains how to read **List Items** from a **SharePoint List** using
1414

1515
---
1616

17-
## 🔹 Supported Options for `list_items`
17+
## Supported Options for `list_items`
1818

1919
| Option | Description | Required |
2020
|--------------|-----------------------------------------------------------|----------|

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins:
1313

1414
nav:
1515
- Home: index.md
16+
- Getting Started: getting-started.md
1617
- Guides:
1718
- List Items: guides/list-items.md
1819
- Available Resource: api/resources/index.md

0 commit comments

Comments
 (0)