Python client for Perforce Helix Swarm (review board)
Project description
Status
Documentation
Installation
There are two identical packages: helix-swarm and alias helixswarm.
pip3 install -U helix-swarm
Examples
Get review info:
from helixswarm import SwarmClient
client = SwarmClient('http://server/api/v9', 'login', 'password')
review = client.reviews.get_info(12345)
print(review['review']['author'])
Add comment to review (async):
import asyncio
from helixswarm import SwarmAsyncClient
client = SwarmAsyncClient('http://server/api/v5', 'login', 'password')
async def example():
await client.comments.add('reviews/12345', 'my awesome comment')
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(example())
finally:
loop.run_until_complete(client.close())
loop.close()
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',
'login',
'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
Official REST API documentation
API |
Date |
Notes |
---|---|---|
October 2019 |
Integration with CI tools |
|
April 2018 |
Review append and replace changelist, 2fa, mark comment as read |
|
December 2017 |
Default reviewers |
|
October 2017 |
Groups as review participants, groups as moderators of project |
|
May 2017 |
Activity dashboard, archiving reviews, cleaning reviews, for voting reviews |
|
v5 |
October 2016 |
Limiting comments to a specific review version |
October 2016 |
Private projects, file-level and line-level inline comments |
|
v3 |
September 2016 |
Comments management |
May 2016 |
Projects, groups |
|
October 2015 |
Author filter to the list reviews endpoint |
|
January 201 |
Required reviewers |
|
July 2014 |
Initial |
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 Distribution
Built Distribution
Hashes for helix_swarm-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9255c65d878b0b1a9ac8b905f714eff86bea706803db0a2610ea8e029cf485c9 |
|
MD5 | 9e419ebdd31c51e4dcc6e4d306b208b6 |
|
BLAKE2b-256 | 136579fd74e64e23c0db67c204a3e9f05e498faee14a1577d6cbcd9b47eabc8f |