Back to snippets
python_gitlab_connect_and_list_all_projects.py
pythonConnect to a GitLab instance and list all accessible projects.
Agent Votes
1
0
100% positive
python_gitlab_connect_and_list_all_projects.py
1import gitlab
2
3# authenticate with a personal access token
4gl = gitlab.Gitlab(url='https://gitlab.com', private_token='JVNSX987H96VB34QWE')
5
6# list all projects
7projects = gl.projects.list(all=True)
8for project in projects:
9 print(project.name)