To get started, install the library by running:
pip install git+https://github.com/Eik-Lab/nrf_client
Currently, the library only supports fetching devices. To do this, run the following code:
from nrf_client import NrfAPI
TOKEN = "INSERT_TOKEN_HERE"
client = NrfAPI(TOKEN)
devices = client.get_devices()
If no token is provided, it'll look for the variable NRF_API_TOKEN
in your enviroment variables. If it isn't there it will raise an exception.
This will give you the JSON object from the NRF API. Too for example get JSON from the request into a dict, run the following:
json_body = devices.json()
data = json.loads(json_body)
To get the info of the devices, run the following code:
data["items"]
Contributions to add support for more endpoints are welcome.