Skip to main content

Python client for Perforce Helix Swarm (review board)

Project description

Build status Docs status Coverage status Version status Downloads status 1 Downloads status 2


Package supports sync and async syntax with same code base.

from helixswarm import SwarmAsyncClient, SwarmClient

Documentation

Read the Docs

Official REST API PDF

Installation

There are two identical packages: helix-swarm and alias helixswarm, alias was created one year later due name confusion, to be import name and package name will the same.

pip3 install helixswarm

Examples

Get review info:

from helixswarm import SwarmClient

client = SwarmClient('http://server/api/v9', 'user', 'password')
review = client.reviews.get_info(12345)
print(review['review']['author'])

Add comment to review in async way (be careful SwarmAsyncClient must be called inside async function):

import asyncio
from helixswarm import SwarmAsyncClient

async def example():
    client = SwarmAsyncClient('http://server/api/v5', 'user', 'password')
    await client.comments.add('reviews/12345', 'my awesome comment')

asyncio.run(example())

Update credentials handler:

import requests
from helixswarm import SwarmClient

def get_credentials():
    response = requests.get(...).json()
    return response['user'], response['password']

client = SwarmClient(
    'http://server/api/v9',
    'user',
    'password',
    auth_update_callback=get_credentials
)

# let's suppose credentials are valid now
review = client.reviews.get_info(12345)
print(review['review']['author'])

# now, after some time, password of user somehow changed, so our callback
# will be called, new credentials will be using for retry and future
# here we get also correct review data instead of SwarmUnauthorizedError
# exception
review = client.reviews.get_info(12345)
print(review['review']['author'])

Testing

Prerequisites: tox

Then just run tox, all dependencies and checks will run automatically

tox

Contributing

Feel free to any contributions.

Mirror repositories of review board source code:

Latest version of code can be download from official page: https://www.perforce.com/downloads/helix-swarm

Official REST API documentation

API

Date

Notes

v10

October 2019

Integration with CI tools

v9

April 2018

Review append and replace changelist, 2fa, mark comment as read

v8

December 2017

Default reviewers

v7

October 2017

Groups as review participants, groups as moderators of project

v6

May 2017

Activity dashboard, archiving reviews, cleaning reviews, for voting reviews

v5

October 2016

Limiting comments to a specific review version

v4

October 2016

Private projects, file-level and line-level inline comments

v3

September 2016

Comments management

v2

May 2016

Projects, groups

v1.2

October 2015

Author filter to the list reviews endpoint

v1.1

January 201

Required reviewers

v1

July 2014

Initial

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

helixswarm-0.7.3.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

helixswarm-0.7.3-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file helixswarm-0.7.3.tar.gz.

File metadata

  • Download URL: helixswarm-0.7.3.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for helixswarm-0.7.3.tar.gz
Algorithm Hash digest
SHA256 11bf8dd8f0ed5e062fdaf37fdf1670e2425ab6e7d8d3bd5d5a727aea0419b099
MD5 bb1a2b8b9fc194f0ce029ee09dd4494f
BLAKE2b-256 7aa74655a4fb7360ae5160bb6332e24e4d14bec18aaff4420c4103833177cb73

See more details on using hashes here.

File details

Details for the file helixswarm-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: helixswarm-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for helixswarm-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2ef969e60928a4eae606b3a5d9f242522d3ed09819274635ca87df51960e9700
MD5 4b5f4b8920723be5b1e3aa95610c8d10
BLAKE2b-256 e0dae88e2f51e59ca5bcff7a2f12532f8cb97c37a5b561ba11e80ad37a7eeec1

See more details on using hashes here.

Supported by

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