Webs
A web (also called a site) is a SharePoint container for lists, libraries,
and pages. Every site has one root web and optionally many subsites.
Prerequisites
| Requirement |
Description |
Reference |
| Read access to the web |
Required to read properties and lists. Site Owner for configuration operations. |
SharePoint admin roles |
How webs are structured
graph TD
Root["Root Web\n(/sites/team)"]
Sub1["Subsite\n(/sites/team/hr)"]
Sub2["Subsite\n(/sites/team/it)"]
List["Lists /\nLibraries"]
SubSub["Sub-subsite\n(/sites/team/hr/benefits)"]
Root --> Sub1
Root --> Sub2
Root --> List
Sub1 --> SubSub
Every site has a root web. Webs can nest as subsites to form a hierarchy.
The current context's web property represents the site you're connected to.
Examples
Read
Quick start
from office365.sharepoint.client_context import ClientContext
ctx = ClientContext("https://contoso.sharepoint.com/sites/team").with_client_certificate(
"contoso.onmicrosoft.com", client_id="client_id", thumbprint="thumbprint", cert_path="./cert.pem"
)
# Get web properties
web = ctx.web.get().execute_query()
print(f"Title: {web.title}, URL: {web.url}, Template: {web.get_web_template()}")
API reference