Run:
sudo pip install python-gitlab
This is the configuration to access the main GitLab server (gitlab.com).
-
Go to your GitLab account and create a personal access token with API access. You will use it below instead of
MY_TOKEN
. -
Create a file in
~/.python-gitlab.cfg
with the following content:
[global]
default = main
ssl_verify = true
[main]
url = https://gitlab.com
private_token = MY_TOKEN