Giter VIP home page Giter VIP logo

helix-swarm's Introduction

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

API Date Notes
v11 >= 2022.1 Extended the v10 APIs and further standardized the endpoint and response pattern for the new rich User Interface.Integration with CI tools
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

helix-swarm's People

Contributors

pbelskiy avatar heikonardmann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.