skillfed

python-gitlab

The python wrapper for the GitLab REST and GraphQL APIs.

python-gitlab v8.5.0 21.0M downloads/30d#1,018 on PyPI2,471
Copyleft license LGPL-3.0-or-later Active released

What it is and what it does

python-gitlab is a Python client library that wraps GitLab's v4 REST API and provides both synchronous and asynchronous GraphQL clients. It lets you write Pythonic code to manage GitLab resources—projects, issues, merge requests, users, and more—without hand-crafting HTTP requests. The package includes a command-line tool (gitlab) for direct API access and handles common concerns like authentication, retries, rate limiting, pagination, and URL encoding automatically.

The library depends on requests and requests-toolbelt for HTTP communication and supports Python 3.10 and later. It's designed for system administrators and developers who need to automate GitLab operations, integrate GitLab into larger workflows, or script repetitive tasks. You can pass arbitrary parameters to the API, access endpoints as soon as they're available on GitLab, and use persistent sessions for proxy and certificate handling.

Use it for:

  • Automate GitLab project and user management tasks in CI/CD pipelines or administrative scripts.
  • Query and modify issues, merge requests, and other resources programmatically from Python applications.
  • Build custom integrations between GitLab and external systems using REST or GraphQL APIs.
  • Write CLI scripts to manage GitLab instances without manual web UI interaction.
  • Implement rate-limit-aware bulk operations on GitLab resources with automatic retry logic.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python wrapper for GitLab's REST and GraphQL APIs, with a CLI tool for managing GitLab resources and accessing API endpoints.

Yes. The package is actively maintained, has low install friction, no known vulnerabilities, and is in the top 5000 PyPI packages by download volume. The copyleft license is standard for GitLab tooling. Install it if you need to programmatically interact with GitLab APIs from Python.

Install

python-gitlab on PyPI

pip

pip install python-gitlab

uv

uv add python-gitlab

poetry

poetry add python-gitlab

Installing python-gitlab

Before you install

Low friction install with only two runtime dependencies (requests and requests-toolbelt). Active maintenance with a recent release 17 days ago and consistent commit activity.

License in practice

Licensed under LGPL-3.0-or-later (copyleft). Any derivative work or distribution must preserve the same license terms and make source code available.

Quickstart

pip install python-gitlab

import gitlab

gl = gitlab.Gitlab('https://gitlab.example.com', private_token='your-token')
project = gl.projects.get('project-id')
print(project.name)

Requires Python 3.10 or later and a valid GitLab instance URL with authentication token.

Verify before relying

  • Whether async GraphQL support requires additional dependencies beyond requests and requests-toolbelt.
  • Performance characteristics when handling large paginated responses or high-volume API calls.
  • Specific GitLab server version compatibility beyond the general API v4 support.

Package facts

License LGPL-3.0-or-later (copyleft)
Python support supports the current Python release (>=3.10.0)
Install friction low — pure-Python wheel
Runtime dependencies 2 — requests, requests-toolbelt
Maintenance actively maintained — 17 days since the last release
Last repo commit
First released
Downloads 21,035,573/month — #1,018 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_gitlab-8.5.0-py3-none-any.whl

Keywords: api, client, gitlab, python, python-gitlab, wrapper

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: System AdministratorsLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Natural Language :: EnglishOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

gitlab api client pythongitlab rest api wrappergitlab graphql clientgitlab cli toolmanage gitlab resources pythongitlab automationgitlab api access
gitlab-integrationapi-clientdevops-automation

More WWW/HTTP packages