Skip to main content

Python client for Helix Swarm

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

Metadata

Release files for helixswarm 0.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for helixswarm 0.7.4
File Size Uploaded
helixswarm-0.7.4.tar.gz 29.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for helixswarm 0.7.4
File Interpreter ABI Platform
helixswarm-0.7.4-py3-none-any.whl Python 3 none any Details

Total release size: 68.2 kB

Release files / helixswarm-0.7.4.tar.gz

Download URL helixswarm-0.7.4.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b03654b810c9a3594faaf850e3f5563088abdc8d2b769782bcb641258cf7f2a7
BLAKE2b-256 checksum
How to use checksums
09be1f9f833f37720fba730c003d047c99fd958942337692bf5c7bdcd1797065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / helixswarm-0.7.4-py3-none-any.whl

Download URL helixswarm-0.7.4-py3-none-any.whl
Size 38.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ee3b54125e54a81fbbea56e078f7cc30ab2556a1b845a5f08d2765a8e50b512
BLAKE2b-256 checksum
How to use checksums
3dd31104bbd5a766c75e0621e30d90263114df2b94ffecd4a5df57cae34ca07b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.7.4 This release

2 release files

0.7.3

2 release files

0.7.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page