Metadata-Version: 2.4
Name: hexway-hive-api
Version: 0.7.0
Summary: API wrapper for Hexway Hive
Author-email: Cur1iosity <cur1iosity@protonmail.com>
Project-URL: Homepage, https://github.com/Cur1iosity/hexway-hive-api
Project-URL: Documentation, https://github.com/Cur1iosity/hexway-hive-api/blob/main/docs/methods.md
Project-URL: Changelog, https://github.com/Cur1iosity/hexway-hive-api/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/Cur1iosity/hexway-hive-api/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.4.0
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: synchronicity<0.13,>=0.12.7
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pyyaml>=6; extra == "dev"
Requires-Dist: openapi-schema-validator>=0.6; extra == "dev"
Requires-Dist: synchronicity[compile]<0.13,>=0.12.7; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Dynamic: license-file

<div align="center">

# Hexway Hive API

[![Tests](https://img.shields.io/github/actions/workflow/status/Cur1iosity/hexway-hive-api/run-tests.yml?branch=main&event=push&label=tests)](https://github.com/Cur1iosity/hexway-hive-api/actions/workflows/run-tests.yml)
[![PyPI](https://img.shields.io/pypi/v/hexway-hive-api)](https://pypi.org/project/hexway-hive-api/)
[![Python](https://img.shields.io/pypi/pyversions/hexway-hive-api)](https://pypi.org/project/hexway-hive-api/)
[![API coverage](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FCur1iosity%2Fhexway-hive-api%2Fmain%2Fapi_coverage_info%2Fcoverage.json&query=%24.percent&suffix=%25&label=API%20coverage&color=blue)](https://github.com/Cur1iosity/hexway-hive-api/blob/main/api_coverage_info/COVERAGE.md)
[![License](https://img.shields.io/github/license/Cur1iosity/hexway-hive-api)](https://github.com/Cur1iosity/hexway-hive-api/blob/main/LICENSE)
[![Downloads](https://static.pepy.tech/badge/hexway-hive-api)](https://pepy.tech/projects/hexway-hive-api)
[![Last commit](https://img.shields.io/github/last-commit/Cur1iosity/hexway-hive-api/main)](https://github.com/Cur1iosity/hexway-hive-api/commits/main/)

</div>

Unofficial Python client for the Hexway Hive WebAPI. It calls Hive API methods
from Python, which is useful in scripts and when you connect Hive to your own web
applications. There is a blocking client and an asyncio client with the same
methods.

## Installation

```bash
pip install hexway-hive-api
```

Requires Python 3.11 or newer. Tested with Hexway Hive 2026.11.1.

## Quick Start

```python
import asyncio
from hexway_hive_api import AsyncRestClient, RestClient

AUTH = {"server": "https://hive.example.com", "username": "someuser", "password": "somepassword"}

# Blocking client: log in once, then call its methods
hive = RestClient().connect(**AUTH)
# Active projects with "web" in the name, description or custom fields
projects = hive.get_projects({"isArchived": False, "search": "web"})["items"]
# Rename the first one. Its other fields do not change
hive.update_project(projects[0]["projectId"], {"name": "Web pentest (retest)"})

# Or stay logged in for a with block only. The logout at the end
# ends every session of this user, also in the browser
with RestClient().connection(**AUTH) as client:
    print(client.get_me()["userName"])


# Async client. The same methods, called with await
async def main() -> None:
    async with AsyncRestClient().connection(**AUTH) as client:
        project_id = "3f2b6a3e-1d7c-4b8e-9a51-2c4d6e8f0a11"
        # Two requests in parallel
        project, issues = await asyncio.gather(
            client.get_project(project_id),
            client.get_issues(project_id, limit=50),
        )
        print(project["projectName"], issues["totalCount"])


asyncio.run(main())
```

Methods, their arguments and Hive's answers are described in [docs/methods.md](https://github.com/Cur1iosity/hexway-hive-api/blob/main/docs/methods.md).
Release notes are in [CHANGELOG.md](https://github.com/Cur1iosity/hexway-hive-api/blob/main/CHANGELOG.md).

## API coverage

![API coverage by library version](https://raw.githubusercontent.com/Cur1iosity/hexway-hive-api/coverage-assets/coverage.svg)

Coverage by API section: [api_coverage_info/COVERAGE.md](https://github.com/Cur1iosity/hexway-hive-api/blob/main/api_coverage_info/COVERAGE.md).

## Development

```bash
pip install -e ".[dev]"
pytest
```

The tests do not need a Hive server. How they work: [docs/testing.md](https://github.com/Cur1iosity/hexway-hive-api/blob/main/docs/testing.md).

## License

MIT, see [LICENSE](https://github.com/Cur1iosity/hexway-hive-api/blob/main/LICENSE).
