🔍 Code Extractor

class TopFilesSharingInsights

Maturity: 31

A SharePoint entity class representing insights about the most shared files in a tenant, providing access to file sharing analytics data.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/insights/top_files_sharing.py
Lines:
4 - 9
Complexity:
simple

Purpose

This class serves as a data model for SharePoint Online tenant administration, specifically for retrieving and representing insights about top shared files. It inherits from the Entity base class and provides the entity type identifier used by SharePoint's REST API to query file sharing statistics and analytics. This is typically used in tenant-level administrative operations to monitor and analyze file sharing patterns across a SharePoint tenant.

Source Code

class TopFilesSharingInsights(Entity):
    @property
    def entity_type_name(self):
        return (
            "Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights"
        )

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Inherits from Entity class which provides the base functionality for SharePoint entities including property management, REST API communication, and entity lifecycle management

Return Value

Instantiation returns a TopFilesSharingInsights object that represents a SharePoint entity. The entity_type_name property returns a string identifying the SharePoint entity type: 'Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights'

Class Interface

Methods

@property entity_type_name(self) -> str property

Purpose: Returns the fully qualified entity type name used by SharePoint REST API to identify this entity type

Returns: String containing 'Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights' which is the SharePoint entity type identifier

Attributes

Name Type Description Scope
entity_type_name str Read-only property that returns the SharePoint entity type identifier for top files sharing insights instance

Dependencies

  • office365

Required Imports

from office365.sharepoint.entity import Entity
from office365.sharepoint.tenant.administration.top_files_sharing_insights import TopFilesSharingInsights

Usage Example

from office365.sharepoint.client_context import ClientContext
from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.tenant.administration.top_files_sharing_insights import TopFilesSharingInsights

# Authenticate to SharePoint
site_url = 'https://yourtenant-admin.sharepoint.com'
credentials = UserCredential('admin@yourtenant.onmicrosoft.com', 'password')
ctx = ClientContext(site_url).with_credentials(credentials)

# Create or retrieve TopFilesSharingInsights entity
insights = TopFilesSharingInsights(ctx)

# Access entity type name
print(insights.entity_type_name)
# Output: Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights

# Load and access properties (inherited from Entity)
insights.load()
ctx.execute_query()

Best Practices

  • This class should be instantiated with a valid ClientContext that has tenant administrator permissions
  • Always call load() and execute_query() to populate entity properties from SharePoint
  • The entity_type_name property is primarily used internally by the Office365 REST client for API communication
  • This is a read-only entity for retrieving insights; it does not support create/update/delete operations
  • Ensure proper authentication with tenant admin rights before attempting to access sharing insights
  • Handle exceptions that may occur during API calls to SharePoint
  • The class follows the Entity pattern from office365-rest-python-client library, so familiarize yourself with Entity base class methods

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SharedInsight 78.1% similar

    A class representing insights about files shared with or by a specific user in Microsoft 365, including email attachments, OneDrive for Business, and SharePoint files.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/insights/shared.py
  • class ObjectSharingInformation 69.5% similar

    A class that provides comprehensive information about the sharing state of SharePoint securable objects (documents, list items, sites), including permissions, sharing links, and user access details.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/object_sharing_information.py
  • class CollaborationInsightsData 67.9% similar

    A data class representing collaboration insights data for SharePoint tenant administration, containing information about collaborative users and the last report date.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/collaboration/insights_data.py
  • class UsedInsight 67.6% similar

    A class representing insights about documents used by a specific user, tracking the most relevant documents viewed or modified in OneDrive for Business and SharePoint.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/insights/used.py
  • class CollaborationInsightsOverview 66.4% similar

    A data class representing collaboration insights overview information for SharePoint tenant administration, inheriting from ClientValue to provide serialization capabilities.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/collaboration/insights_overview.py
← Back to Browse