Afficher la pageAnciennes révisionsLiens de retourHaut de page Cette page est en lecture seule. Vous pouvez afficher le texte source, mais ne pourrez pas le modifier. Contactez votre administrateur si vous pensez qu'il s'agit d'une erreur. ====== API de Git en Python ====== https://gitpython.readthedocs.io/en/stable/ ==== Gitlab ==== https://python-gitlab.readthedocs.io <code bash> sudo pip3 install --upgrade python-gitlab </code> <code python> 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) </code> ==== GitHub ==== https://pygithub.readthedocs.io/en/latest/index.html <code bash> sudo pip3 install --upgrade pygithub </code> <code python> import github gh = github.Github('<private token>') projects = gh.get_user().get_repos(); for p in projects: print(p.full_name + " - " + p.ssh_url) </code> git-python-api.txt Dernière modification : 2021/06/03 20:49de phsw