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!