Using python-gitlab module, I am able to get the list of members from a gitlab repo. Below is the example code for the same -
#!/usr/bin/env python
import gitlab
from utils.secrets import gitlab_token
import csv
gl = gitlab.Gitlab('https://repo.webengage.com', gitlab_token,
api_version=4)
projects = gl.projects.list(get_all=True)
csv_file = './maintainers_report.csv'
for project in projects:
contributors = project.members_all.list(get_all=True)
print(contributors)
I also want the source from where their access has been inherited.