Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gitlab python
#!/bin/env python3
import gitlab
import sys
# private token or personal token authentication
gl = gitlab.Gitlab('https://gitlab.com/', private_token='******')
if len(sys.argv) > 1:
if sys.argv[1].find("/") > 0:
project=sys.argv[1]
else:
project="volterra/ves.io/"+sys.argv[1]
gl.auth()
project = gl.projects.get(project)
print(project.id)
else:
print("Usage: %s [yourorg/]projectName" % sys.argv[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.