Questions tagged [python-gitlab]

The python-gitlab library is a Python library that provides bindings for interacting with GitLab, an open-source git repository manager that features multiple features such as issue tracking, wikis, and continuous integration features.

python-gitlab is a Python library that provides bindings for the GitLab API v4 for interacting with GitLab, an open-source git repository manager that features multiple features such as issue tracking, wikis, and continuous integration features.

See the python-gitlab repo on Github.

See read-the-docs

68 questions
0
votes
1 answer

How can I get information from Git about metadata changes over a certain period of time using Git Python?

Need to pull information about metadata changes from the project in the git (there is a local copy), namely: The number of commits per file (code, metadata) for 2 weeks on a certain branch on the folder na_gold'force-app/main/default' import…
Miekrif
  • 55
  • 7
0
votes
1 answer

Python version for curl --output

I have a GitLab API (v4) that I need to call to get a project sub-directory (something apparently new in v.14.4, it seems not yet included python-gitlab libs), which in curl can be done with the following command: curl --header "PRIVATE-TOKEN:…
xCovelus
  • 578
  • 1
  • 9
  • 20
0
votes
1 answer

Get GitLab Issue Service Desk Email via API

I'm creating a separate app for users to visualize GitLab issues without needing access to GitLab. We are using python-gitlab to retrieve the issue data for display on this separate site. Users will create new issues by clicking a button that opens…
Kellen
  • 278
  • 2
  • 8
0
votes
3 answers

Python to extract output from attribute

I am trying to extract the specific details like authored_date from the attribute which I am getting with help of python. What is my end goal: I want to extract the specific branches which are named as tobedeleted_branch1, tobedeleted_branch2 and…
Sameer Atharkar
  • 382
  • 1
  • 3
  • 17
0
votes
1 answer

Delete Specific branch with Python-Gitlab module

I am extreme beginner in writing python scripts as I am learning it currently. I am writing a code where I am going to extract the branches which I have which are named something like tobedeleted_branch1 , tobedeleted_branch2 etc with the help of…
Sameer Atharkar
  • 382
  • 1
  • 3
  • 17
0
votes
1 answer

Python Git and Git-Lab create project and push code/commit

We are building an automation process using python in which we clone a base source code repository and add necessary changes to it and add the new code to a new git repository and push it to our private gitlab server. So far I'm using git library to…
0
votes
1 answer

Python Gitlab API invite group to project

I'm trying to add a gitlab group to a project after the project is created. I can see in the Gitlab API documentation that it's possible to invite a MEMBER to a group to or a project (https://docs.gitlab.com/ee/api/invitations.html) It's however…
Martin Cronje
  • 175
  • 1
  • 6
0
votes
1 answer

Download GitLab file with gitlab-python

I am trying to download a file or folder from my gitlab repository, but they only way I have seen to do it is using CURL and command line. Is there any way to download files from the repository with just the python-gitlab API? I have read through…
0
votes
1 answer

Retrieving project coverage with python-gitlab

I use the python-gitlab module to retrieve the project statistics for a number of projects in Gitlab via its API. One of the values I want to get is the CI status and the code coverage. While the status is easy: from gitlab import Gitlab gl =…
olebole
  • 521
  • 4
  • 17
0
votes
1 answer

Update multiple files python-gitlab

I want to update multiple files in my Gitlab repository using python-gitlab. I know how to update a single file but I do not want to update each file one by one. Normally, we achieve this using these commands: Make your changes Git add Git…
0
votes
1 answer

gitlab CLI - get project variable value

I am basically trying to do this gl = gitlab.Gitlab('git.mygit.com', private_token='my_token') gl.projects.get(ID).variables.get('KEY').value but using CLI commands. I can get to the correct variable, but cannot access the value gitlab…
0
votes
1 answer

python-gitlab : How to list all issues in a specific milestone

I need some help. how to list all issues in a specific milestone? this is my script group = gl.groups.get(53) for project in group.milestones.list(search='TestMilestone'): print(project) group = gl.groups.get(53) for issues in…
rkevx21
  • 2,441
  • 5
  • 19
  • 40
0
votes
4 answers

how to process output from python-gitlab api requests

for instance the call gl = gitlab.Gitlab('http://192.168.2.175', private_token=run_args['my_token']) projects = gl.projects.list() for project in projects: print(project) produces output that cannot be processed as json. What is the process for…
0
votes
1 answer

How can I obtain the registry repositories and tags associated with a specific gitlab project

I'd like to grab the associated registry repositories and tags for a gitlab project. Right now my code attempts to do this for a single project but later I'll have to scale this for multiple projects and update as the tags are updated. Here's my…
py_noob
  • 433
  • 2
  • 8
  • 17
0
votes
0 answers

Not able to authenticate in GitLab through username and password using python requests

I am using the following python code provided as an alternative to the now defunct usage of the username and password in the python-gitlab library which acts as a wrapper over the GitLab REST API to login into GitLab: import re import sys import…
Saurav Saha
  • 745
  • 1
  • 11
  • 30