Skip to content

Cur1iosity/hexway-hive-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Tests PyPI Hexway

Hexway Hive API

Unofficial flexible library for HexWay Hive REST API.

Tested on HexWay Hive 0.65.6

Installation

pip install hexway-hive-api

Dependencies

  • pydantic ~= 2.4
  • requests ~= 2.31.0
  • aiohttp ~= 3.9.0

Usage

Synchronous client

from hexway_hive_api import RestClient


def main() -> None:
    auth = {
        "server": "https://demohive.hexway.io/",
        "username": "someuser",
        "password": "somepassword",
    }
    with RestClient().connection(**auth) as client:
        projects = client.get_projects().get("items")
        client.update_project(project_id=1, fields={"name": "New Project Name"})


if __name__ == "__main__":
    main()

Asynchronous client

import asyncio
from hexway_hive_api import AsyncRestClient


async def main() -> None:
    auth = {
        "server": "https://demohive.hexway.io/",
        "username": "someuser",
        "password": "somepassword",
    }
    async with AsyncRestClient().connection(**auth) as client:
        projects = (await client.get_projects()).get("items")
        await client.update_project(project_id=1, fields={"name": "New Project Name"})


asyncio.run(main())

TLS configuration

AsyncHTTPClient accepts an optional ssl context in its constructor or through :meth:update_params. This context will be passed to all requests if no ssl argument is provided explicitly. Verification of server certificates can be toggled via the verify_ssl flag or verify parameter in :meth:update_params and individual request methods. Disabling verification will still keep TLS encryption enabled. AsyncRestClient.connect also respects the verify / verify_ssl options when establishing the session.

About

Unofficial python wrapper for Hexway Hive API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages