Skip to main content

Client library for interacting with Gerrit's REST API

Project description

https://img.shields.io/pypi/v/pygerrit2.png https://img.shields.io/pypi/dm/pygerrit2.png https://img.shields.io/pypi/l/pygerrit2.png

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygerrit2-2.0.0.tar.gz (13.4 kB view details)

Uploaded Source

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

Hashes for pygerrit2-2.0.0.tar.gz
Algorithm Hash digest
SHA256 97f10f1d61de212bf0c7abf97de9de359a16806c420cdd06a67e0d6a32584118
MD5 c57462527f9acafd03eecb7c02ff90e4
BLAKE2b-256 9671289d8fd30f942f6454dfb69b90f6039fedbd7dfe98085b206c5842d47314

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page