Skip to main content

Official Python client for BindThings IoT Platform

Project description

BindThings Python

Official Python client for the BindThings IoT Platform.

Installation

pip install bindthings

Quick Start

from bindthings import BindThings

bt = BindThings("YOUR_DEVICE_TOKEN")
bt.connect()
bt.send({"temperature": 25.5, "humidity": 60})

API Reference

Constructor

bt = BindThings(token, client_id=None)

Connect

bt.connect()              # Background thread (non-blocking)
bt.connect(blocking=True) # Foreground (blocking)

Send Telemetry

bt.send({"temperature": 25.5})
bt.send({"temperature": 25.5, "humidity": 60, "pressure": 1013})

Receive Commands

def on_command(payload: str):
    import json
    data = json.loads(payload)
    print(data)

bt.on_command(on_command)

Status

bt.set_online(True)   # Mark device as online
bt.set_online(False)  # Mark device as offline
bt.is_connected()     # Check connection
bt.disconnect()       # Graceful disconnect

Examples

Example Description
basic.py Send temperature and humidity every 15 seconds
dht22.py Read DHT22 on Raspberry Pi and send to BindThings

Connection Details

Parameter Value
Broker mqtt.bindthings.io
Port 8883 (TLS)
Username Your Device Token
Password Your Device Token

License

MIT License — © 2025 BindThings

Project details


Download files

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

Source Distribution

bindthings-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

bindthings-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file bindthings-1.0.0.tar.gz.

File metadata

  • Download URL: bindthings-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bindthings-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d61d5c1e4c577bc19ba4d25c4d5e24e7041425033a9bd90e84b0c3ba8ae92593
MD5 31d9c6cbddc885bc15aa6a8907358c78
BLAKE2b-256 49c0feaeb1e50c33519ce512b1a84eadce80fbcf8706e967ce03cfddc4db4a7d

See more details on using hashes here.

File details

Details for the file bindthings-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bindthings-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bindthings-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 896ec5c66c38034355beecbe692221842730d62ead10ba77cb461b9e70447c97
MD5 a9eab2fb2f40d1f157ebbc040d54f4b8
BLAKE2b-256 f2f12f871da41997c654bcce3f6b059b524a17cbf078759c2e45e5a7c36b6219

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