Skip to main content

Gitlab Client

Install

To install latest version:

pip install gitlab-v4

To install a specific version, for example: 0.0.1

pip install gitlab-v4==0.0.1

Usage

from gitlab_client.gitlab_client import Gitlab

client = Gitlab(
	project_id="1234",
	access_token="abcd1234-efgh5678",
	gitlab_base_url="https://gitlab.com/api/v4"
)

Once you instantiated a client instance as shown above, you can call different api methods available. To list all branches in project:

client.list_branches()

Sample response:

[
  {
	'name': 'main',
	'commit': {
		'id': 'abc123d357ae0ecc2d071eg3b64l4367861840fb',
		'short_id': 'abc123d3',
		'created_at': '2021-08-10T06:08:11.000+00:00',
		'parent_ids': None,
		'title': 'Update readme file',
		'message': 'Update readme file',
		'author_name': 'John Doe',
		'author_email': 'johndoe@users.noreply.gitlab.com',
		'authored_date': '2021-08-10T06:08:11.000+00:00',
		'committer_name': 'John Doe',
		'committer_email': 'johndoe@users.noreply.gitlab.com',
		'committed_date': '2021-08-10T06:08:11.000+00:00',
		'trailers': None,
		'web_url': 'https://gitlab.com/group_name/repo_name/-/commit/abc123d357ae0ecc2d071eg3b64l4367861840fb'
	},
	'merged': False,
	'protected': True,
	'developers_can_push': False,
	'developers_can_merge': False,
	'can_push': True,
	'default': True,
	'web_url': 'https://gitlab.com/group_name/repo_name/-/tree/main'
  },
  {
	'name': 'stable',
	'commit': {
		'id': 'def456d357ae0ecc2d071eg3b64l4367861840fb',
		'short_id': 'def456d3',
		'created_at': '2021-08-10T07:14:35.000+00:00',
		'parent_ids': None,
		'title': "some title",
		'message': "Merge branch 'main' into 'stable'",
		'author_name': 'Jane Doe',
		'author_email': 'janedoe@users.noreply.gitlab.com',
		'authored_date': '2021-08-10T07:14:35.000+00:00',
		'committer_name': 'Jane Doe',
		'committer_email': 'janedoe@users.noreply.gitlab.com',
		'committed_date': '2021-08-10T07:14:35.000+00:00',
		'trailers': None,
		'web_url': 'https://gitlab.com/group_name/repo_name/-/commit/def456d357ae0ecc2d071eg3b64l4367861840fb'
	},
	'merged': False,
	'protected': True,
	'developers_can_push': False,
	'developers_can_merge': False,
	'can_push': True,
	'default': False,
	'web_url': 'https://gitlab.com/group_name/repo_name/-/tree/stable'
  }
]

Release files for gitlab-v4 0.0.7

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

Source distribution (sdist)

Source distribution for gitlab-v4 0.0.7
File Size Uploaded
gitlab_v4-0.0.7.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitlab-v4 0.0.7
File Interpreter ABI Platform
gitlab_v4-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / gitlab_v4-0.0.7.tar.gz

Download URL gitlab_v4-0.0.7.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
02fb22f788a4c6d99a99099a02c626237086354c6c7df5d536db3c77aa81a6ee
BLAKE2b-256 checksum
How to use checksums
4c82c1684866a42da294603804eaa5615fd9b1f3ec1ddb9704fcc45c62c35afa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.2

Release files / gitlab_v4-0.0.7-py3-none-any.whl

Download URL gitlab_v4-0.0.7-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
084239fa363f2e973f5f1dab9c9cb9a89f185e4ae5dc256e06273d640220e8ae
BLAKE2b-256 checksum
How to use checksums
24f53ab542c9669d6ed7a0f85143b5a13940850f941a1ca95bb4bad739672cdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

1 release file

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