Skip to content

Instantly share code, notes, and snippets.

@pdr-tuche
Last active December 21, 2023 04:42
Show Gist options
  • Save pdr-tuche/aa723bafe36e734207283dc0eb9bab3e to your computer and use it in GitHub Desktop.
Save pdr-tuche/aa723bafe36e734207283dc0eb9bab3e to your computer and use it in GitHub Desktop.
Request to gitlab API
import requests
user_name = input("digite aqui o seu usuário do gitlab: ")
response = requests.get(f"https://gitlab.com/api/v4/users/{user_name}/projects") #type -> <class 'requests.models.Response'>
lista_meus_projetos = response.json() #type -> <class 'list'> O metodo json converte o tipo para lista
for projeto in lista_meus_projetos:
print(f"nome do projeto: {projeto['name']} \nURL do projeto: {projeto['web_url']}\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment