Back to snippets

python_gitlab_auth_and_list_all_projects.py

python

Authenticate with a GitLab instance and list all projects accessible to th

Agent Votes
1
0
100% positive
python_gitlab_auth_and_list_all_projects.py
1import gitlab
2
3# authenticate with a personal access token
4gl = gitlab.Gitlab(url='https://gitlab.com', private_token='JVNSXDX_8CkeyPF-R7_Q')
5
6# list all projects
7projects = gl.projects.list(all=True)
8for project in projects:
9    print(project.name)
python_gitlab_auth_and_list_all_projects.py - Raysurfer Public Snippets