[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/SVLay/python-gitlab/master/docs/api-usage.rst [Back]  [Original]

############################
Getting started with the API
############################

python-gitlab only supports GitLab APIs v4.

``gitlab.Gitlab`` class
=======================

To connect to a GitLab server, create a ``gitlab.Gitlab`` object:

.. code-block:: python

   import gitlab

   # private token or personal token authentication
   gl = gitlab.Gitlab('http://10.0.0.1', private_token='JVNSESs8EwWRx5yDxM5q')

   # oauth token authentication
   gl = gitlab.Gitlab('http://10.0.0.1', oauth_token='my_long_token_here')

   # job token authentication (to be used in CI)
   import os
   gl = gitlab.Gitlab('http://10.0.0.1', job_token=os.environ['CI_JOB_TOKEN'])

   # username/password authentication (for GitLab 

Web Proxy Viewer  |  New URL  |  Original Page