Skip to main content

GitLab API

Version: 0.4.0

GitLab API Python Wrapper

Includes a large variety of API calls to GitLab

This repository is actively maintained and will continue adding more API calls

API Calls:

  • Branches
  • Commits
  • Deploy Tokens
  • Groups
  • Jobs
  • Members
  • Merge Request
  • Merge Rules
  • Packages
  • Pipeline
  • Projects
  • Protected Branches
  • Runners
  • Users
  • Wiki

Usage:

#!/usr/bin/python
# coding: utf-8
import gitlab_api

token = "<GITLAB_TOKEN/PERSONAL_TOKEN>"
gitlab_url = "<GITLAB_URL>"
client = gitlab_api.Api(url=gitlab_url, token=token)

users = client.get_users()
print(users)

created_merge_request = client.create_merge_request(project_id=123, source_branch="development", 
                                                    target_branch="production",title="Merge Request Title")
print(created_merge_request)

print(f"Users: {client.get_users()}")

print(f"Projects: {client.get_projects()}")

response = client.get_runners(runner_type='instance_type', all_runners=True)
print(f"Runners: {response}")

Install Instructions

Install Python Package

python -m pip install gitlab-api

Build Instructions

Build Python Package

sudo chmod +x ./*.py
pip install .
python setup.py bdist_wheel --universal
# Test Pypi
twine upload --repository-url https://test.pypi.org/legacy/ dist/* --verbose -u "Username" -p "Password"
# Prod Pypi
twine upload dist/* --verbose -u "Username" -p "Password"

Metadata

Release files for gitlab-api 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for gitlab-api 0.4.0
File Interpreter ABI Platform Actions
gitlab_api-0.4.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for gitlab_api-0.4.0-py2.py3-none-any.whl

Release files / gitlab_api-0.4.0-py2.py3-none-any.whl

Download URL gitlab_api-0.4.0-py2.py3-none-any.whl
Size 14.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c5fba862d7407492fb15d5825319ffddc17a19d99624445d605d8413a446f280
BLAKE2b-256 checksum
How to use checksums
e06ffbe8df31540722b77a4871aa92077d5ecbbabe1aa6077d9db0d4f3826091
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for gitlab-api 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page