https://github.com/sparkmeter/py-nerves-hub-client
Python client for NervesHub user API
https://github.com/sparkmeter/py-nerves-hub-client
Last synced: 3 months ago
JSON representation
Python client for NervesHub user API
- Host: GitHub
- URL: https://github.com/sparkmeter/py-nerves-hub-client
- Owner: sparkmeter
- License: mit
- Created: 2022-02-03T19:15:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T00:02:14.000Z (over 3 years ago)
- Last Synced: 2024-12-31T15:52:59.701Z (over 1 year ago)
- Language: Python
- Size: 225 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
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
```