Get group members in Python (connectapi)

Hi All,

Is there a way to retrieve information about the group members and the current user in Python (dash)?
I know this can be easily done in R respectively via:

  • get_group_members (using the connectapi library)
  • session$user

Is there a similar functionality for Python? Something similar to connectapi?

I found this post from last year. And I am wondering if there has been any progress.
link

Hi @xander85,

Excellent question, there are a few parts of this to consider, I will outline the below:

From a Python code/app perspective to get information on the currently logged-in user/group you can follow the example posted here in the Connect User Guide: https://docs.posit.co/connect/user/dash/#user-meta-data.

To retrieve information about members of a certain group (once you know the group GUID) you can use the Connect API from any language (R, Python, terminal, etc.). This is the endpoint to use, which contains a Python code example too: Posit Connect API Reference

connectapi is a great package in R and does a lot of helpful things but at its core, it is making queries to the Connect API so you should be able to replicate much of the behavior with calls to the various endpoints listed on this page.

Hopefully, this gets you started, happy to help answer anything follow-ups!

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.