@@ -9528,6 +9528,35 @@ def get_organization_overview(self, organization: str, token: Union[bool, str, N
95289528 hf_raise_for_status (r )
95299529 return Organization (** r .json ())
95309530
9531+ @validate_hf_hub_args
9532+ def list_organization_followers (self , organization : str , token : Union [bool , str , None ] = None ) -> Iterable [User ]:
9533+ """
9534+ List followers of an organization on the Hub.
9535+
9536+ Args:
9537+ organization (`str`):
9538+ Name of the organization to get the followers of.
9539+ token (`bool` or `str`, *optional*):
9540+ A valid user access token (string). Defaults to the locally saved
9541+ token, which is the recommended method for authentication (see
9542+ https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
9543+ To disable authentication, pass `False`.
9544+
9545+ Returns:
9546+ `Iterable[User]`: A list of [`User`] objects with the followers of the organization.
9547+
9548+ Raises:
9549+ [`HfHubHTTPError`]:
9550+ HTTP 404 If the organization does not exist on the Hub.
9551+
9552+ """
9553+ for follower in paginate (
9554+ path = f"{ constants .ENDPOINT } /api/organizations/{ organization } /followers" ,
9555+ params = {},
9556+ headers = self ._build_hf_headers (token = token ),
9557+ ):
9558+ yield User (** follower )
9559+
95319560 def list_organization_members (self , organization : str , token : Union [bool , str , None ] = None ) -> Iterable [User ]:
95329561 """
95339562 List of members of an organization on the Hub.
@@ -10819,6 +10848,7 @@ def _parse_revision_from_pr_url(pr_url: str) -> str:
1081910848# User API
1082010849get_user_overview = api .get_user_overview
1082110850get_organization_overview = api .get_organization_overview
10851+ list_organization_followers = api .list_organization_followers
1082210852list_organization_members = api .list_organization_members
1082310853list_user_followers = api .list_user_followers
1082410854list_user_following = api .list_user_following
0 commit comments