class UserInfoItem
UserInfoItem is a specialized SharePoint list item class that represents a user information item, inheriting all functionality from the ListItem base class.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/listitems/user_info_item.py
4 - 5
simple
Purpose
This class serves as a domain-specific representation of user information items in SharePoint. It extends the ListItem class to provide a semantic type for working with user-related data stored in SharePoint lists. The class acts as a data model for user information entries, allowing developers to interact with SharePoint user data through a typed interface. As it currently contains no additional implementation beyond the base class, it primarily serves as a type marker for distinguishing user information items from generic list items in the SharePoint object model.
Source Code
class UserInfoItem(ListItem):
pass
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ListItem | - |
Parameter Details
bases: Inherits from ListItem, which is the base class for all SharePoint list items. This provides all standard list item functionality including CRUD operations, property access, and SharePoint API integration.
Return Value
Instantiation returns a UserInfoItem object that represents a specific user information entry in a SharePoint list. The object provides access to all inherited ListItem methods and properties for interacting with the underlying SharePoint data.
Class Interface
Methods
__init__(context, resource_path=None, properties=None)
Purpose: Initializes a UserInfoItem instance (inherited from ListItem)
Parameters:
context: ClientContext object for SharePoint API communicationresource_path: Optional ResourcePath object specifying the item's location in SharePointproperties: Optional dictionary of initial property values for the item
Returns: UserInfoItem instance
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
properties |
dict | Dictionary containing the SharePoint item properties including user information fields like Title, EMail, UserName, etc. (inherited from ListItem) | instance |
context |
ClientContext | The SharePoint client context used for API operations (inherited from ListItem) | instance |
resource_path |
ResourcePath | The resource path identifying this item's location in SharePoint (inherited from ListItem) | instance |
Dependencies
office365-rest-python-client
Required Imports
from office365.sharepoint.listitems.listitem import ListItem
from office365.sharepoint.userinfo.user_info_item import UserInfoItem
Usage Example
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.userinfo.user_info_item import UserInfoItem
# Authenticate to SharePoint
ctx = ClientContext('https://yourtenant.sharepoint.com/sites/yoursite').with_credentials(
UserCredential('username@domain.com', 'password')
)
# Get user information list
user_info_list = ctx.web.site_user_info_list
user_items = user_info_list.items.get().execute_query()
# Access user information items
for item in user_items:
if isinstance(item, UserInfoItem):
print(f"User: {item.properties.get('Title')}")
print(f"Email: {item.properties.get('EMail')}")
Best Practices
- This class is typically instantiated by the SharePoint API client library rather than directly by user code
- Use this class for type checking and type hints when working with user information items to distinguish them from generic list items
- Access user properties through the inherited 'properties' attribute from ListItem
- Ensure proper authentication and permissions are configured before attempting to access user information lists
- The class inherits all methods from ListItem, so refer to ListItem documentation for available operations like update(), delete(), and property access
- User information lists in SharePoint are special system lists that may have restricted access depending on permissions
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class UserInfo 76.2% similar
-
class ListItemCreationInformation 63.3% similar
-
class UserDirectoryInfo 63.3% similar
-
class UserIdInfo 62.2% similar
-
class FieldUser 61.8% similar