Skip to main content

Chirpstack Python API

Project description

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chirpstack-api-3.1.8.tar.gz (104.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chirpstack_api-3.1.8-py3-none-any.whl (125.3 kB view details)

Uploaded Python 3

File details

Details for the file chirpstack-api-3.1.8.tar.gz.

File metadata

  • Download URL: chirpstack-api-3.1.8.tar.gz
  • Upload date:
  • Size: 104.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for chirpstack-api-3.1.8.tar.gz
Algorithm Hash digest
SHA256 de616a32fc1a554df0fa9156f43d37893096a93b7be0fc60573795d15699360c
MD5 517cbc10d93fe8f5e5c058048422a75c
BLAKE2b-256 2d6ad24df79a40b570531be0707e69a92482290a5eedcdc8ca1cda3a1e17bf94

See more details on using hashes here.

File details

Details for the file chirpstack_api-3.1.8-py3-none-any.whl.

File metadata

  • Download URL: chirpstack_api-3.1.8-py3-none-any.whl
  • Upload date:
  • Size: 125.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for chirpstack_api-3.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7efe1e012ee28b1580212b60242c13cf42288b89ee26e1976016204318f2eead
MD5 c6b4d53e4215c2014778ab9b48151d6b
BLAKE2b-256 2a397c4b69a37e9902fb89dc5443a2f7a75498385948b41a2090fffb0233541e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page