helixswarm


Namehelixswarm JSON
Version 0.7.4 PyPI version JSON
download
home_pagehttps://github.com/pbelskiy/helix-swarm
SummaryPython client for Perforce Helix Swarm (review board)
upload_time2023-01-01 11:55:33
maintainer
docs_urlNone
authorPetr Belskiy
requires_python>=3.7
licenseMIT
keywords helix swarm swarm review perforce helix swarm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Python client for `Helix Swarm <https://www.perforce.com/manuals/swarm/>`_
==========================================================================

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

.. |Build status|
   image:: https://github.com/pbelskiy/helix-swarm/workflows/Tests/badge.svg
.. |Docs status|
   image:: https://readthedocs.org/projects/helix-swarm/badge/?version=latest
.. |Coverage status|
   image:: https://img.shields.io/coveralls/github/pbelskiy/helix-swarm?label=Coverage
.. |Version status|
   image:: https://img.shields.io/pypi/pyversions/helix-swarm?label=Python
.. |Downloads status 1|
    image:: https://img.shields.io/pypi/dm/helix-swarm?color=1&label=Downloads
.. |Downloads status 2|
    image:: https://img.shields.io/pypi/dm/helixswarm?color=1&label=Downloads

----

Package supports sync and async syntax with same code base.

.. code:: python

    from helixswarm import SwarmAsyncClient, SwarmClient

Documentation
-------------

`Read the Docs <https://helix-swarm.readthedocs.io/en/latest/>`_

`Official REST API PDF <https://github.com/pbelskiy/helix-swarm/blob/master/docs/swarm.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:

.. code:: python

    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):

.. code:: python

    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:

.. code:: python

    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:
  - `2022.1 <https://github.com/dfrees/swarm>`_
  - `2016.1 <https://github.com/stewartlord/swarm>`_

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

`Official REST API documentation <https://www.perforce.com/manuals/swarm/Content/Swarm/swarm-apidoc.html>`_
-----------------------------------------------------------------------------------------------------------

+------------+----------------+-----------------------------------------------------------------------------+
| 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                                                                     |
+------------+----------------+-----------------------------------------------------------------------------+

.. _v10: https://www.perforce.com/manuals/swarm/Content/Swarm/swarm-apidoc_endpoints-v10.html
.. _v9: https://www.perforce.com/manuals/v19.1/swarm/Content/Swarm/swarm-apidoc.html
.. _v8: https://www.perforce.com/manuals/v17.4/swarm/#Swarm/swarm-apidoc.html
.. _v7: https://www.perforce.com/manuals/v17.3/swarm/index.html#Swarm/swarm-apidoc.html
.. _v6: https://www.perforce.com/manuals/v17.2/swarm/api.html
.. _v4: https://www.perforce.com/perforce/r16.2/manuals/swarm/api.html
.. _v2: https://www.perforce.com/perforce/r16.1/manuals/swarm/api.html
.. _v1.2: https://www.perforce.com/perforce/r15.3/manuals/swarm/api.html
.. _v1.1: https://www.perforce.com/perforce/r14.4/manuals/swarm/api.html
.. _v1: https://www.perforce.com/perforce/r14.3/manuals/swarm/api.html

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pbelskiy/helix-swarm",
    "name": "helixswarm",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "helix,swarm,swarm review,perforce helix swarm",
    "author": "Petr Belskiy",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/09/be/1f9f833f37720fba730c003d047c99fd958942337692bf5c7bdcd1797065/helixswarm-0.7.4.tar.gz",
    "platform": null,
    "description": "Python client for `Helix Swarm <https://www.perforce.com/manuals/swarm/>`_\n==========================================================================\n\n|Build status|\n|Docs status|\n|Coverage status|\n|Version status|\n|Downloads status 1|\n|Downloads status 2|\n\n.. |Build status|\n   image:: https://github.com/pbelskiy/helix-swarm/workflows/Tests/badge.svg\n.. |Docs status|\n   image:: https://readthedocs.org/projects/helix-swarm/badge/?version=latest\n.. |Coverage status|\n   image:: https://img.shields.io/coveralls/github/pbelskiy/helix-swarm?label=Coverage\n.. |Version status|\n   image:: https://img.shields.io/pypi/pyversions/helix-swarm?label=Python\n.. |Downloads status 1|\n    image:: https://img.shields.io/pypi/dm/helix-swarm?color=1&label=Downloads\n.. |Downloads status 2|\n    image:: https://img.shields.io/pypi/dm/helixswarm?color=1&label=Downloads\n\n----\n\nPackage supports sync and async syntax with same code base.\n\n.. code:: python\n\n    from helixswarm import SwarmAsyncClient, SwarmClient\n\nDocumentation\n-------------\n\n`Read the Docs <https://helix-swarm.readthedocs.io/en/latest/>`_\n\n`Official REST API PDF <https://github.com/pbelskiy/helix-swarm/blob/master/docs/swarm.pdf>`_\n\nInstallation\n------------\n\nThere are two identical packages: ``helix-swarm`` and alias ``helixswarm``, alias\nwas created one year later due name confusion, to be import name and package name will the same.\n\n::\n\n    pip3 install helixswarm\n\nExamples\n--------\n\nGet review info:\n\n.. code:: python\n\n    from helixswarm import SwarmClient\n\n    client = SwarmClient('http://server/api/v9', 'user', 'password')\n    review = client.reviews.get_info(12345)\n    print(review['review']['author'])\n\nAdd comment to review in async way (be careful ``SwarmAsyncClient`` must be called inside async function):\n\n.. code:: python\n\n    import asyncio\n    from helixswarm import SwarmAsyncClient\n\n    async def example():\n        client = SwarmAsyncClient('http://server/api/v5', 'user', 'password')\n        await client.comments.add('reviews/12345', 'my awesome comment')\n\n    asyncio.run(example())\n\n\nUpdate credentials handler:\n\n.. code:: python\n\n    import requests\n    from helixswarm import SwarmClient\n\n    def get_credentials():\n        response = requests.get(...).json()\n        return response['user'], response['password']\n\n    client = SwarmClient(\n        'http://server/api/v9',\n        'user',\n        'password',\n        auth_update_callback=get_credentials\n    )\n\n    # let's suppose credentials are valid now\n    review = client.reviews.get_info(12345)\n    print(review['review']['author'])\n\n    # now, after some time, password of user somehow changed, so our callback\n    # will be called, new credentials will be using for retry and future\n    # here we get also correct review data instead of SwarmUnauthorizedError\n    # exception\n    review = client.reviews.get_info(12345)\n    print(review['review']['author'])\n\nTesting\n-------\n\nPrerequisites: `tox`\n\nThen just run tox, all dependencies and checks will run automatically\n\n::\n\n    tox\n\nContributing\n------------\n\nFeel free to any contributions.\n\nMirror repositories of review board source code:\n  - `2022.1 <https://github.com/dfrees/swarm>`_\n  - `2016.1 <https://github.com/stewartlord/swarm>`_\n\nLatest version of code can be download from official page:\nhttps://www.perforce.com/downloads/helix-swarm\n\n`Official REST API documentation <https://www.perforce.com/manuals/swarm/Content/Swarm/swarm-apidoc.html>`_\n-----------------------------------------------------------------------------------------------------------\n\n+------------+----------------+-----------------------------------------------------------------------------+\n| API        | Date           | Notes                                                                       |\n+============+================+=============================================================================+\n| `v10`_     | October 2019   | Integration with CI tools                                                   |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v9`_      | April 2018     | Review append and replace changelist, 2fa, mark comment as read             |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v8`_      | December 2017  | Default reviewers                                                           |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v7`_      | October 2017   | Groups as review participants, groups as moderators of project              |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v6`_      | May 2017       | Activity dashboard, archiving reviews, cleaning reviews, for voting reviews |\n+------------+----------------+-----------------------------------------------------------------------------+\n| v5         | October 2016   | Limiting comments to a specific review version                              |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v4`_      | October 2016   | Private projects, file-level and line-level inline comments                 |\n+------------+----------------+-----------------------------------------------------------------------------+\n| v3         | September 2016 | Comments management                                                         |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v2`_      | May 2016       | Projects, groups                                                            |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v1.2`_    | October 2015   | Author filter to the list reviews endpoint                                  |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v1.1`_    | January 201    | Required reviewers                                                          |\n+------------+----------------+-----------------------------------------------------------------------------+\n| `v1`_      | July 2014      | Initial                                                                     |\n+------------+----------------+-----------------------------------------------------------------------------+\n\n.. _v10: https://www.perforce.com/manuals/swarm/Content/Swarm/swarm-apidoc_endpoints-v10.html\n.. _v9: https://www.perforce.com/manuals/v19.1/swarm/Content/Swarm/swarm-apidoc.html\n.. _v8: https://www.perforce.com/manuals/v17.4/swarm/#Swarm/swarm-apidoc.html\n.. _v7: https://www.perforce.com/manuals/v17.3/swarm/index.html#Swarm/swarm-apidoc.html\n.. _v6: https://www.perforce.com/manuals/v17.2/swarm/api.html\n.. _v4: https://www.perforce.com/perforce/r16.2/manuals/swarm/api.html\n.. _v2: https://www.perforce.com/perforce/r16.1/manuals/swarm/api.html\n.. _v1.2: https://www.perforce.com/perforce/r15.3/manuals/swarm/api.html\n.. _v1.1: https://www.perforce.com/perforce/r14.4/manuals/swarm/api.html\n.. _v1: https://www.perforce.com/perforce/r14.3/manuals/swarm/api.html\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for Perforce Helix Swarm (review board)",
    "version": "0.7.4",
    "split_keywords": [
        "helix",
        "swarm",
        "swarm review",
        "perforce helix swarm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "138478b5edb7951423f98035e446ab09",
                "sha256": "3ee3b54125e54a81fbbea56e078f7cc30ab2556a1b845a5f08d2765a8e50b512"
            },
            "downloads": -1,
            "filename": "helixswarm-0.7.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "138478b5edb7951423f98035e446ab09",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 38819,
            "upload_time": "2023-01-01T11:55:31",
            "upload_time_iso_8601": "2023-01-01T11:55:31.261204Z",
            "url": "https://files.pythonhosted.org/packages/3d/d3/1104bbd5a766c75e0621e30d90263114df2b94ffecd4a5df57cae34ca07b/helixswarm-0.7.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "2814223bbaea17aaebf87600467c228d",
                "sha256": "b03654b810c9a3594faaf850e3f5563088abdc8d2b769782bcb641258cf7f2a7"
            },
            "downloads": -1,
            "filename": "helixswarm-0.7.4.tar.gz",
            "has_sig": false,
            "md5_digest": "2814223bbaea17aaebf87600467c228d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 29371,
            "upload_time": "2023-01-01T11:55:33",
            "upload_time_iso_8601": "2023-01-01T11:55:33.543613Z",
            "url": "https://files.pythonhosted.org/packages/09/be/1f9f833f37720fba730c003d047c99fd958942337692bf5c7bdcd1797065/helixswarm-0.7.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-01 11:55:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pbelskiy",
    "github_project": "helix-swarm",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "helixswarm"
}
        
Elapsed time: 0.03081s