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.6.11
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.6.11.tar.gz | 121.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chirpstack_api-3.6.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 261.0 kB
Release files / chirpstack-api-3.6.11.tar.gz
| Download URL | chirpstack-api-3.6.11.tar.gz |
|---|---|
| Size | 121.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e376f6d876700a9555d1cc41536d48783bbd4adee44da34b57e3ffe4d1a35f5
|
|
BLAKE2b-256 checksum How to use checksums |
a37147a771e899666b663e22979dfd5234006a95dd46fa708eb6a0f787e8bb78
|
| 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/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Release files / chirpstack_api-3.6.11-py3-none-any.whl
| Download URL | chirpstack_api-3.6.11-py3-none-any.whl |
|---|---|
| Size | 140.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c40bb14a13ac66fa606c93df7ce5450b43aa911ae9e98d85511b9a62c5c3231e
|
|
BLAKE2b-256 checksum How to use checksums |
e42140eec4a0ec5303417adb68162b9c69d4170b400a70e2f5c31da8224edc3c
|
| 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/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|