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

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

python-gitlab supports both GitLab v3 and v4 APIs.

v3 being deprecated by GitLab, its support in python-gitlab will be minimal.
The development team will focus on v4.

v4 is the default API used by python-gitlab since version 1.3.0.


``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')

   # username/password authentication (for GitLab 

Web Proxy Viewer  |  New URL  |  Original Page