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.8
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.8.tar.gz | 117.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chirpstack_api-3.6.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 254.7 kB
Release files / chirpstack-api-3.6.8.tar.gz
| Download URL | chirpstack-api-3.6.8.tar.gz |
|---|---|
| Size | 117.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
254e207570dafd71cbefd4a818d868ee0cee7f878a1e923aab67ad08f56bcbe1
|
|
BLAKE2b-256 checksum How to use checksums |
c65f23765963816ad626d5c230723636d3993a3919ce7fac2af85b4670eaddaf
|
| 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.8-py3-none-any.whl
| Download URL | chirpstack_api-3.6.8-py3-none-any.whl |
|---|---|
| Size | 136.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fb25761ec27addd5d48bcbbaf5eefc4b3e0f80e5af3992d70ce38200595be04
|
|
BLAKE2b-256 checksum How to use checksums |
592a943a912db22edd64982329ef7728447b08394d01776938cd1e6cdbfd2174
|
| 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
|