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.5.2
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.5.2.tar.gz | 116.3 kB | Details |
Release files / chirpstack-api-3.5.2.tar.gz
| Download URL | chirpstack-api-3.5.2.tar.gz |
|---|---|
| Size | 116.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c3b8acb9074c0caabd11d7c36c4b47df3402e9f5f885d1ddde17915ae69a9f0
|
|
BLAKE2b-256 checksum How to use checksums |
d3a7e4d94a81ee14d94f10df7d1dfe25756dd6610c45e0ae1bb0e8ec1f0e9d2b
|
| 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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|