quickbuild


Namequickbuild JSON
Version 0.18.0 PyPI version JSON
download
home_pagehttps://github.com/pbelskiy/quickbuild
SummaryPython client for PMEase QuickBuild
upload_time2023-01-19 20:29:59
maintainer
docs_urlNone
authorPetr Belskiy
requires_python>=3.7
licenseMIT
keywords pmease quickbuild
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Python client for PMEase `QuickBuild <https://www.pmease.com/quickbuild>`_
==========================================================================

|Build status|
|Docs status|
|Coverage status|
|Version status|
|Downloads status|

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

----

Package supports sync and async syntax with same code base.

.. code:: python

    from quickbuild import AsyncQBClient, QBClient

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

`Package Read the Docs <https://quickbuild.readthedocs.io/en/latest/>`_

`Official REST API documentation <https://wiki.pmease.com/display/QB12/RESTful+API>`_

`Available REST API Clients <https://wiki.pmease.com/display/QB12/Available+Clients>`_

Installation
------------

.. code:: shell

    pip3 install quickbuild

Examples
--------

Get server version:

.. code:: python

    from quickbuild import QBClient

    client = QBClient('https://server', 'user', 'password')
    version = client.system.get_version()
    print(version)

Get server version in async way (be careful ``AsyncQBClient`` must be called inside async function):

.. code:: python

    import asyncio
    from quickbuild import AsyncQBClient

    async def main():
        client = AsyncQBClient('https://server', 'user', 'password')
        version = await client.system.get_version()
        print(version)
        await client.close()

    asyncio.run(main())

Stop build:

.. code:: python

    from quickbuild import QBClient

    client = QBClient('https://server', 'user', 'password')
    client.builds.stop(123)


Update credentials handler:

.. code:: python

    import asyncio
    import aiohttp
    from quickbuild import AsyncQBClient

    async def get_credentials():
        async with aiohttp.ClientSession() as session:
            async with session.get('...') as resp:
                response = await resp.json()
                return response['user'], response['password']

    async def main():
        client = AsyncQBClient('http://server', 'user', 'password',
                                auth_update_callback=get_credentials)

        # let's suppose credentials are valid now
        print(await client.builds.get_status(12345))

        # 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 build info instead of QBUnauthorizedError exception
        print(await client.builds.get_status(12345))

        await client.close()

    asyncio.run(main())


Content type
------------

By default QuickBuild returns XML content, but starting from 10 version it also
has native support of JSON content, usually it's much more convenient to use
native Python types (parsed XML) instead of pure XML string.

So, that is why three types of content were indtoduced, this type and behavior
can be set globally for client instances, and can be rewritten for some methods.

- PARSE (using by default)
    - GET: parse XML to native Python types.
    - POST: pure XML string.

- XML
    - GET: return native XML without any transformations.
    - POST: pure XML string.

- JSON (QuickBuild 10+)
    - GET: parsed JSON string.
    - POST: dumps object to JSON string.

Development
-----------

It's possible to run QuickBuild community edition locally using docker:

Build locally:

.. code:: shell

    docker build .  -f docker/QB10.Dockerfile -t quickbuild:10
    docker run --restart always --name qb10 -d -p 8810:8810 quickbuild:10

Or run prepared image:

.. code:: shell

    docker run --restart always --name qb10 -d -p 8810:8810 pbelskiy/quickbuild:10

Then open http://localhost:8810/

Testing
-------

Prerequisites: `tox`

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

::

    tox

Contributing
------------

Feel free for any contributions.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pbelskiy/quickbuild",
    "name": "quickbuild",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "PMEase,quickbuild",
    "author": "Petr Belskiy",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/87/a0/a8fcefa5aab375d2e6ce5a4c6239bee82e1677a9d900093f3c4be58b7f2d/quickbuild-0.18.0.tar.gz",
    "platform": null,
    "description": "Python client for PMEase `QuickBuild <https://www.pmease.com/quickbuild>`_\n==========================================================================\n\n|Build status|\n|Docs status|\n|Coverage status|\n|Version status|\n|Downloads status|\n\n.. |Build status|\n   image:: https://github.com/pbelskiy/quickbuild/workflows/Tests/badge.svg\n.. |Docs status|\n   image:: https://readthedocs.org/projects/quickbuild/badge/?version=latest\n.. |Coverage status|\n   image:: https://img.shields.io/coveralls/github/pbelskiy/quickbuild?label=Coverage\n.. |Version status|\n   image:: https://img.shields.io/pypi/pyversions/quickbuild?label=Python\n.. |Downloads status|\n   image:: https://img.shields.io/pypi/dm/quickbuild?color=1&label=Downloads\n\n----\n\nPackage supports sync and async syntax with same code base.\n\n.. code:: python\n\n    from quickbuild import AsyncQBClient, QBClient\n\nDocumentation\n-------------\n\n`Package Read the Docs <https://quickbuild.readthedocs.io/en/latest/>`_\n\n`Official REST API documentation <https://wiki.pmease.com/display/QB12/RESTful+API>`_\n\n`Available REST API Clients <https://wiki.pmease.com/display/QB12/Available+Clients>`_\n\nInstallation\n------------\n\n.. code:: shell\n\n    pip3 install quickbuild\n\nExamples\n--------\n\nGet server version:\n\n.. code:: python\n\n    from quickbuild import QBClient\n\n    client = QBClient('https://server', 'user', 'password')\n    version = client.system.get_version()\n    print(version)\n\nGet server version in async way (be careful ``AsyncQBClient`` must be called inside async function):\n\n.. code:: python\n\n    import asyncio\n    from quickbuild import AsyncQBClient\n\n    async def main():\n        client = AsyncQBClient('https://server', 'user', 'password')\n        version = await client.system.get_version()\n        print(version)\n        await client.close()\n\n    asyncio.run(main())\n\nStop build:\n\n.. code:: python\n\n    from quickbuild import QBClient\n\n    client = QBClient('https://server', 'user', 'password')\n    client.builds.stop(123)\n\n\nUpdate credentials handler:\n\n.. code:: python\n\n    import asyncio\n    import aiohttp\n    from quickbuild import AsyncQBClient\n\n    async def get_credentials():\n        async with aiohttp.ClientSession() as session:\n            async with session.get('...') as resp:\n                response = await resp.json()\n                return response['user'], response['password']\n\n    async def main():\n        client = AsyncQBClient('http://server', 'user', 'password',\n                                auth_update_callback=get_credentials)\n\n        # let's suppose credentials are valid now\n        print(await client.builds.get_status(12345))\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 here\n        # we get also correct build info instead of QBUnauthorizedError exception\n        print(await client.builds.get_status(12345))\n\n        await client.close()\n\n    asyncio.run(main())\n\n\nContent type\n------------\n\nBy default QuickBuild returns XML content, but starting from 10 version it also\nhas native support of JSON content, usually it's much more convenient to use\nnative Python types (parsed XML) instead of pure XML string.\n\nSo, that is why three types of content were indtoduced, this type and behavior\ncan be set globally for client instances, and can be rewritten for some methods.\n\n- PARSE (using by default)\n    - GET: parse XML to native Python types.\n    - POST: pure XML string.\n\n- XML\n    - GET: return native XML without any transformations.\n    - POST: pure XML string.\n\n- JSON (QuickBuild 10+)\n    - GET: parsed JSON string.\n    - POST: dumps object to JSON string.\n\nDevelopment\n-----------\n\nIt's possible to run QuickBuild community edition locally using docker:\n\nBuild locally:\n\n.. code:: shell\n\n    docker build .  -f docker/QB10.Dockerfile -t quickbuild:10\n    docker run --restart always --name qb10 -d -p 8810:8810 quickbuild:10\n\nOr run prepared image:\n\n.. code:: shell\n\n    docker run --restart always --name qb10 -d -p 8810:8810 pbelskiy/quickbuild:10\n\nThen open http://localhost:8810/\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 for any contributions.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for PMEase QuickBuild",
    "version": "0.18.0",
    "split_keywords": [
        "pmease",
        "quickbuild"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a287381a4d82d89188a900cc727c56a824ea74bf437dd226c2367dc613346f47",
                "md5": "c2fb1d217eb9281386c5d98a18da8f8c",
                "sha256": "cb3ae88b860abf63f62cd4bc6e595a23f2c19311cfe04d94e8a3f2aa25ca5c67"
            },
            "downloads": -1,
            "filename": "quickbuild-0.18.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c2fb1d217eb9281386c5d98a18da8f8c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 65407,
            "upload_time": "2023-01-19T20:29:57",
            "upload_time_iso_8601": "2023-01-19T20:29:57.484889Z",
            "url": "https://files.pythonhosted.org/packages/a2/87/381a4d82d89188a900cc727c56a824ea74bf437dd226c2367dc613346f47/quickbuild-0.18.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87a0a8fcefa5aab375d2e6ce5a4c6239bee82e1677a9d900093f3c4be58b7f2d",
                "md5": "777237112f5fbd83dbfd24907fcc54d6",
                "sha256": "3cf51fe3a4456bc7c56b9fa5dda8775f8dd6606470ad6b3b55c63a741279e59a"
            },
            "downloads": -1,
            "filename": "quickbuild-0.18.0.tar.gz",
            "has_sig": false,
            "md5_digest": "777237112f5fbd83dbfd24907fcc54d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 42296,
            "upload_time": "2023-01-19T20:29:59",
            "upload_time_iso_8601": "2023-01-19T20:29:59.602380Z",
            "url": "https://files.pythonhosted.org/packages/87/a0/a8fcefa5aab375d2e6ce5a4c6239bee82e1677a9d900093f3c4be58b7f2d/quickbuild-0.18.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-19 20:29:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pbelskiy",
    "github_project": "quickbuild",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "quickbuild"
}
        
Elapsed time: 0.02845s