CLI tool and Python API wrapper for Gerrit Code Review.
Project description
python-gerritclient
CLI tool and Python API wrapper for Gerrit Code Review
Quick Start
Command Line Tool
Clone python-gerritclient repository: git clone https://github.com/tivaliy/python-gerritclient.git.
Configure settings.yaml file (in gerritclient/settings.yaml) to meet your requirements.
url: http://review.example.com auth_type: basic username: admin password:
"1234567890aaWmmflSl+ZlOPs23Dffn"url can be specified according to the following format <scheme>://<host>:<port>, e.g. https://review.openstack.org
auth_type specifies HTTP authentication scheme (basic or digest), can be omitted, then all requests will be anonymous with respective restrictions
username and password - user credentials from Gerrit system (Settings → HTTP Password)
Create isolated Python environment virtualenv gerritclient_venv and activate it source gerritclient_venv/bin/activate.
Install python-gerritclient with all necessary dependencies: pip install python-gerritclient/..
(Optional) Add gerrit command bash completion gerrit complete | sudo tee /etc/bash_completion.d/gc.bash_completion > /dev/null
Run gerrit command with required options, e.g. gerrit plugin list. To see all available commands run gerrit --help.
Library
Clone python-gerritclient repository: git clone https://github.com/tivaliy/python-gerritclient.git.
Create isolated Python environment virtualenv gerritclient_venv and activate it source gerritclient_venv/bin/activate.
Install python-gerritclient with all necessary dependencies: pip install python-gerritclient/..
from gerritclient import client
connection = client.connect("review.openstack.org", auth_type="digest" username="user-name", password="password")
group_client = client.get_client('group', connection=connection)
members = group_client.get_group_members('swift-core') # or get_group_members(24)
print(', '.join(member['name'] for member in members))
Output result: Alistair Coles, Christian Schwede, Clay Gerrard, Darrell Bishop, David Goetz, Greg Lange, Janie Richling, John Dickinson, Kota Tsuyuzaki, Mahati Chamarthy, Matthew Oliver, Michael Barton, Pete Zaitcev, Samuel Merritt, Thiago da Silva, Tim Burke
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 Distributions
Built Distribution
Hashes for python_gerritclient-0.0.1.dev137-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98142380d89cbc5f5af0deb0e812307c264a067a5fe34b29d0a7d41a4b66acd |
|
MD5 | 659cb557848416e15711ae10872cd65f |
|
BLAKE2b-256 | 479aa3d8c309a96193e4f4c90826443a0749b5e560a64f80c412c4a36c165dfc |