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"
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)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitlab_api-0.4.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
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
|