Client library for interacting with Gerrit's REST API
Project description
Pygerrit2 provides a simple interface for clients to interact with Gerrit Code Review via the REST API.
Prerequisites
Pygerrit2 has been tested on Ubuntu 10.4 and Mac OSX 10.8.4, with Python 2.6.x and 2.7.x. Support for other platforms and Python versions is not guaranteed.
Pygerrit2 depends on the requests library.
Installation
To install pygerrit2, simply:
$ pip install pygerrit2
Configuration
For easier connection to the review server over the REST API, the user’s HTTP username and password can be given in the user’s .netrc file:
machine review login MyUsername password MyPassword
For instructions on how to obtain the HTTP password, refer to Gerrit’s HTTP upload settings documentation.
REST API
This simple example shows how to get the user’s open changes, authenticating to Gerrit via HTTP Digest authentication using an explicitly given username and password:
>>> from requests.auth import HTTPDigestAuth >>> from pygerrit2.rest import GerritRestAPI >>> auth = HTTPDigestAuth('username', 'password') >>> rest = GerritRestAPI(url='http://review.example.net', auth=auth) >>> changes = rest.get("/changes/?q=owner:self%20status:open")
Refer to the example script for a more detailed example of how the REST API interface works.
Copyright and License
Copyright 2011 Sony Ericsson Mobile Communications. All rights reserved.
Copyright 2012 Sony Mobile Communications. All rights reserved.
Copyright 2016 David Pursehouse. All rights reserved.
Licensed under The MIT License. Please refer to the LICENSE file for full license details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pygerrit2-2.0.0.tar.gz
.
File metadata
- Download URL: pygerrit2-2.0.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f10f1d61de212bf0c7abf97de9de359a16806c420cdd06a67e0d6a32584118 |
|
MD5 | c57462527f9acafd03eecb7c02ff90e4 |
|
BLAKE2b-256 | 9671289d8fd30f942f6454dfb69b90f6039fedbd7dfe98085b206c5842d47314 |