rbtools Python API client

Review Request #3184 - Created July 9, 2012 and submitted

Steven MacLeod
This is the base of the new Python API Client. This includes the finished
synchronous transport, and the bare bones resource classes.

In order to support the full Web API, a few resource specific base classes need
to be added (To download diffs etc.). The current state allows for regular use
of the API, accessing resources, following links, and using the uri templates
from the root resource.

Acknowledgement: Alexander Solovets (mbait) provided initial design work, some
starting code, and inspiration for this implementation. His work set me in the
right direction, and is greatly appreciated.

Example Usage:
    from rbtools.api.client import RBClient

    username = None
    password = None
    url = 'http://reviews.reviewboard.org/api/'
    cookie = 'rbapi.cookie'

    client = RBClient(
    root = client.get_root()

    info = root.get_info()
    print info.product.version

    # Display the first review request.
    requests = root.get_review_requests()
    print requests[0].summary

    # Who are the reviewers?
    for person_link in requests[0].target_people:
        print person_link.get().fullname

    # Lets give a review.
    reviews = requests[0].get_reviews()
    review = reviews.create(
            'body_top': "Nice patch!",
    review.update(data={'public': True})
Manual testing against local Review Board instance, and the r.rb.org instance. All non-resource-specific operations appear to work.

  • 0
  • 0
  • 39
  • 2
  • 41
Description From Last Updated
Christian Hammond
Steven MacLeod
Christian Hammond
Steven MacLeod
Steven MacLeod
Steven MacLeod
Steven MacLeod
Steven MacLeod
Christian Hammond
Steven MacLeod
Christian Hammond
Steven MacLeod
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to api (d43bd5d)