git-python-api

API de Git en Python

https://python-gitlab.readthedocs.io

sudo pip3 install --upgrade python-gitlab
import gitlab
 
gl = gitlab.Gitlab('http://gitlab.com', private_token='xx')
projects = gl.projects.list(visibility='private', all=True) # récupère tous les dépôts
 
for p in projects:
    print(p.path_with_namespace + " - " + p.ssh_url_to_repo)

https://pygithub.readthedocs.io/en/latest/index.html

sudo pip3 install --upgrade pygithub
import github
 
gh = github.Github('<private token>')
projects = gh.get_user().get_repos();
 
for p in projects:
    print(p.full_name + " - " + p.ssh_url)
  • git-python-api.txt
  • Dernière modification : 2021/06/03 20:49
  • de phsw