@@ -1404,16 +1404,48 @@ class Organization:
14041404 Name of the organization on the Hub (unique).
14051405 fullname (`str`):
14061406 Organization's full name.
1407+ details (`str`, *optional*):
1408+ Organization's description.
1409+ is_verified (`bool`, *optional*):
1410+ Whether the organization is verified.
1411+ is_following (`bool`, *optional*):
1412+ Whether the authenticated user follows this organization.
1413+ num_users (`int`, *optional*):
1414+ Number of members in the organization.
1415+ num_models (`int`, *optional*):
1416+ Number of models owned by the organization.
1417+ num_spaces (`int`, *optional*):
1418+ Number of Spaces owned by the organization.
1419+ num_datasets (`int`, *optional*):
1420+ Number of datasets owned by the organization.
1421+ num_followers (`int`, *optional*):
1422+ Number of followers of the organization.
14071423 """
14081424
14091425 avatar_url : str
14101426 name : str
14111427 fullname : str
1428+ details : Optional [str ] = None
1429+ is_verified : Optional [bool ] = None
1430+ is_following : Optional [bool ] = None
1431+ num_users : Optional [int ] = None
1432+ num_models : Optional [int ] = None
1433+ num_spaces : Optional [int ] = None
1434+ num_datasets : Optional [int ] = None
1435+ num_followers : Optional [int ] = None
14121436
14131437 def __init__ (self , ** kwargs ) -> None :
14141438 self .avatar_url = kwargs .pop ("avatarUrl" , "" )
14151439 self .name = kwargs .pop ("name" , "" )
14161440 self .fullname = kwargs .pop ("fullname" , "" )
1441+ self .details = kwargs .pop ("details" , None )
1442+ self .is_verified = kwargs .pop ("isVerified" , None )
1443+ self .is_following = kwargs .pop ("isFollowing" , None )
1444+ self .num_users = kwargs .pop ("numUsers" , None )
1445+ self .num_models = kwargs .pop ("numModels" , None )
1446+ self .num_spaces = kwargs .pop ("numSpaces" , None )
1447+ self .num_datasets = kwargs .pop ("numDatasets" , None )
1448+ self .num_followers = kwargs .pop ("numFollowers" , None )
14171449
14181450 # forward compatibility
14191451 self .__dict__ .update (** kwargs )
@@ -9663,6 +9695,33 @@ def get_user_overview(self, username: str, token: Union[bool, str, None] = None)
96639695 hf_raise_for_status (r )
96649696 return User (** r .json ())
96659697
9698+ @validate_hf_hub_args
9699+ def get_organization_overview (self , organization : str , token : Union [bool , str , None ] = None ) -> Organization :
9700+ """
9701+ Get an overview of an organization on the Hub.
9702+
9703+ Args:
9704+ organization (`str`):
9705+ Name of the organization to get an overview of.
9706+ token (`bool` or `str`, *optional*):
9707+ A valid user access token (string). Defaults to the locally saved token, which is the recommended method
9708+ for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
9709+ To disable authentication, pass `False`.
9710+
9711+ Returns:
9712+ `Organization`: An [`Organization`] object with the organization's overview.
9713+
9714+ Raises:
9715+ [`HTTPError`](https://requests.readthedocs.io/en/latest/api/#requests.HTTPError):
9716+ HTTP 404 If the organization does not exist on the Hub.
9717+ """
9718+ r = get_session ().get (
9719+ f"{ constants .ENDPOINT } /api/organizations/{ organization } /overview" ,
9720+ headers = self ._build_hf_headers (token = token ),
9721+ )
9722+ hf_raise_for_status (r )
9723+ return Organization (** r .json ())
9724+
96669725 def list_organization_members (self , organization : str , token : Union [bool , str , None ] = None ) -> Iterable [User ]:
96679726 """
96689727 List of members of an organization on the Hub.
@@ -10956,6 +11015,7 @@ def _parse_revision_from_pr_url(pr_url: str) -> str:
1095611015
1095711016# User API
1095811017get_user_overview = api .get_user_overview
11018+ get_organization_overview = api .get_organization_overview
1095911019list_organization_members = api .list_organization_members
1096011020list_user_followers = api .list_user_followers
1096111021list_user_following = api .list_user_following
0 commit comments