Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cur1iosity/hivepy
Unofficial flexible library to work with HexWay Hive Rest API
https://github.com/cur1iosity/hivepy
hexway hive python3 python312 rest-api
Last synced: about 2 months ago
JSON representation
Unofficial flexible library to work with HexWay Hive Rest API
- Host: GitHub
- URL: https://github.com/cur1iosity/hivepy
- Owner: Cur1iosity
- Archived: true
- Created: 2023-10-22T14:00:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-24T11:43:14.000Z (4 months ago)
- Last Synced: 2024-09-28T17:02:46.885Z (about 2 months ago)
- Topics: hexway, hive, python3, python312, rest-api
- Language: Python
- Homepage: https://hexway.io/
- Size: 139 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Run Tests](https://github.com/Cur1iosity/hivepy/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Cur1iosity/hivepy/actions/workflows/run-tests.yml)
[![PyPI](https://img.shields.io/pypi/v/hw-hivepy)](https://pypi.org/project/hw-hivepy/)
[![Hexway](https://img.shields.io/badge/hexway-visit%20site-blue)](https://hexway.io)# HivePy
Unofficial flexible library for [HexWay Hive](https://hexway.io/hive/) Rest API.
#### Tested on HexWay Hive 0.62.8
## Installation
```bash
pip install hw-hivepy
```## Dependencies
- pydantic ~= 2.4
- requests ~= 2.31.0## Usage
### API work modes
There are three available modes for the HiveApi:
- (**json**) returns raw json response
- (**raw_items**) returns raw json response with items only
- (**object** [default]) returns parsed json response as object### Simple HiveClient
```python
from hivepy import HiveApidef main() -> None:
"""Main function."""
auth = {
'url': 'http://127.0.0.1',
'username': 'user',
'password': 'password',
}hive: HiveApi = HiveApi().connect(**auth)
# hive.mode = 'json' # Set mode
# Getting projects and its issues
hive.get_projects()
hive.get_project(project_id='some-project-id')
hive.get_issues(project_id='some-project-id')# Download binary file
hive.get_file(project_id='some-project-id', file_id='some-file-id')if __name__ == "__main__":
main()```