chirpstack-api
ChirpStack gRPC API message and service wrappers for Python.
Install
pip install chirpstack-api
Usage
All messages, services, constants, etc. are auto-generated from the ChirpStack protobuf definitions. The result is that this package structure matches that of the protobuf definitions.
The protobuf definitions can be found here: https://github.com/brocaar/chirpstack-api/tree/master/protobuf
The following example presents how the library can be used.
Example
This example shows how to log in to ChirpStack via the gRPC API and then create a gRPC metadata list containing the JWT. This metadata could then be passed to any future requests that require authorization.
import grpc
import os
import sys
from chirpstack_api.as_pb.external import api
if __name__ == '__main__':
# Create the client for the "internal" service
channel = grpc.insecure_channel('localhost:8080')
stub = api.InternalServiceStub(channel)
# Create and build the login request message
loginRequest = api.LoginRequest()
loginRequest.password = 'admin'
loginRequest.username = 'admin'
# Send the login request
token = stub.Login(loginRequest)
# Build the metadata list, settting the authorization from the JWT
# obtained from loggin in.
metadata= [('authorization', token.jwt)]
# This metadata can now be passed for requests to APIs that require
# authorization
Metadata
Release files for chirpstack-api 3.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chirpstack-api-3.2.0.tar.gz | 105.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chirpstack_api-3.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 232.0 kB
Release files / chirpstack-api-3.2.0.tar.gz
| Download URL | chirpstack-api-3.2.0.tar.gz |
|---|---|
| Size | 105.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e91d89a903436b2d6c2707b79f3f33d087b834a7fee6c6d38def26f450c8b97a
|
|
BLAKE2b-256 checksum How to use checksums |
328ab343fa8610d65dcd9a8001b445f51dbe205b6501be66de964013be49e362
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
|
Release files / chirpstack_api-3.2.0-py3-none-any.whl
| Download URL | chirpstack_api-3.2.0-py3-none-any.whl |
|---|---|
| Size | 126.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2e1514c842e51033cf4c4e7ac716d576e4e1d6d17195a87d1604d7cf0add334
|
|
BLAKE2b-256 checksum How to use checksums |
ceab4b7b3368eb3873ca41287ad30fad8d3cdd7cbb2f90fa3b422793cd20a248
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
|