Skip to content

samcday/python-gitlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

36 Commits

Repository files navigation

Python GitLab

python-gitlab is a Python module providing access to the GitLab server API.

It supports the v3 api of GitLab.

Requirements

Only Python 2 is supported for the moment.

python-gitlab depends on python-requests.

State

python-gitlab is a work in progress, although already usable. Changes in the API might happen.

ToDo

  • Improve documentation
  • Write unit tests
  • Write a command line tool to access GitLab servers

Code snippet

# See https://github.com/gitlabhq/gitlabhq/tree/master/doc/api for the source.# Register a connection to a gitlab instance, using its URL and a user private# tokengl=Gitlab('http://192.168.123.107', 'JVNSESs8EwWRx5yDxM5q') # Connect to get the current usergl.auth() # Print the user informationsprintgl.user# Get a list of projectsforpingl.Project(): print (p.name) # get associated issuesissues=p.Issue() forissueinissues: closed=0ifnotissue.closedelse1print (" %d => %s (closed: %d)"% (issue.id, issue.title, closed)) # and close them allissue.closed=1issue.save() # Get the first 10 groups (pagination)forgingl.Group(page=1, per_page=10): print (g) # Create a new projectp=gl.Project({'name': 'myCoolProject', 'wiki_enabled': False}) p.save() printp

About

Python wrapper for the GitLab API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python100.0%