Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sparkmeter/py-nerves-hub-client

Python client for NervesHub user API
https://github.com/sparkmeter/py-nerves-hub-client

Last synced: 7 days ago
JSON representation

Python client for NervesHub user API

Awesome Lists containing this project

README

        

# Python client for NervesHub

A thin wrapper around the NervesHub User API

See https://github.com/nerves-hub/nerves_hub_user_api for more details.

## Usage

Set up your environment

```bash
export NERVES_HUB_ORG="MY ORG"
export NERVES_HUB_PRODUCT="MY PRODUCT"
export NERVES_HUB_CERT="MY USER CERT"
export NERVES_HUB_KEY="MY USER KEY"

# If using a self-hosted NervesHub instance (optional)
export NERVES_HUB_BASE_URL="https://my-nerveshub-domain"
export NERVES_HUB_CA_CERT="MY CA CERT"
```

```python
from nerves_hub_client import NervesHubAPI
api = NervesHubAPI.from_env()
api.device_list()
```

## Development

```bash
# Ensure linting passes before committing
poetry run pre-commit install
```

### Testing

```bash
poetry run pytest --mypy
```

### Manual lint

Linting is run before each commit if you have the pre-commit installed, but
you can run it manually with the following command.

```bash
poetry run pre-commit run
```