Skip to main content

Python bindings for ThingWorx AlwaysOn protocol encoding/decoding

Project description

AlwaysOn Python

License: MIT

Python bindings for the alwayson-codec Rust library, enabling efficient encoding and decoding of ThingWorx AlwaysOn protocol messages in Python.

Features

  • 🚀 High Performance - Rust-powered encoding/decoding
  • 🐍 Pythonic API - Familiar Python interfaces
  • 📦 Zero Dependencies - Self-contained binary wheels
  • 🔧 Complete Protocol Support - All ThingWorx primitive types and messages
  • 🛡️ Type Safety - Comprehensive type hints
  • 📊 Multipart Messages - Handle large message splitting/merging

Installation

pip install alwayson-py

Quick Start

import alwayson

# Create an authentication message
auth_msg = alwayson.TwxMessage.build_auth(12345, "your-app-key")
binary_data = auth_msg.to_bytes()

# Parse binary message
parsed_msg = alwayson.TwxMessage.from_bytes(binary_data)

# Work with InfoTables
shape = alwayson.DataShape()
shape.add_field("temperature", alwayson.BaseType.NUMBER)
shape.add_field("timestamp", alwayson.BaseType.DATETIME)

table = alwayson.InfoTable(shape)
table.add_row({
    "temperature": 23.5,
    "timestamp": alwayson.datetime_now()
})

Development

This project is built with PyO3 and maturin.

Setup

# Clone the repository
git clone https://github.com/xudesheng/alwayson_py.git
cd alwayson_py

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install maturin
pip install maturin[patchelf]

# Development build
maturin develop

Testing

pip install pytest pytest-asyncio
pytest tests/

Related Projects

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Desheng Xu xudesheng@gmail.com

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

alwayson_py-0.2.2.tar.gz (56.3 kB view details)

Uploaded Source

Built Distributions

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

alwayson_py-0.2.2-cp312-cp312-win_amd64.whl (349.6 kB view details)

Uploaded CPython 3.12Windows x86-64

alwayson_py-0.2.2-cp312-cp312-manylinux_2_28_aarch64.whl (530.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

alwayson_py-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (539.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

alwayson_py-0.2.2-cp312-cp312-macosx_11_0_arm64.whl (467.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

alwayson_py-0.2.2-cp312-cp312-macosx_10_12_x86_64.whl (489.1 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file alwayson_py-0.2.2.tar.gz.

File metadata

  • Download URL: alwayson_py-0.2.2.tar.gz
  • Upload date:
  • Size: 56.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for alwayson_py-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ab1de501132b9dd9cf39e4610ed4d709698d629ee27c0ca492e5c1d10d911267
MD5 ae5cede91683106d2f1a43cf6f85cfe6
BLAKE2b-256 ae2cffe42ea3d1087b665e8d6f8e6d8a3a2fd07bd86cd4eff76f59cbaed82b9d

See more details on using hashes here.

File details

Details for the file alwayson_py-0.2.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for alwayson_py-0.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 74a7a2bdf3d28c5e709c9f0dd63ae426477a1de2c2f06dfd82e78b8c7c858534
MD5 68e9bba8ac066b656c2494594fab1a30
BLAKE2b-256 11b1bcb1c77427a177b9a91d1be874984bccda800bf626eb100a06d3098efe1f

See more details on using hashes here.

File details

Details for the file alwayson_py-0.2.2-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for alwayson_py-0.2.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 58a6890d42173ba51eeabbec38f8421d61966883e7da5ede97d661e95ab1c0c6
MD5 9cd83d60b39fad7d2a999cfd172293c2
BLAKE2b-256 bc3aa90f142c8064dbd3003fd38527230195b11899f55283d6128cc120e3f4d3

See more details on using hashes here.

File details

Details for the file alwayson_py-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for alwayson_py-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3a1421221cc907c7ad0f6b7d44e1526ac92ed7a013cd12333d34b2336836483
MD5 9976e07012a8063e05e8393b5c50bcc5
BLAKE2b-256 78232302ad990ac5e9c463c2a4c00860b8933f42151ba2d403e5af9babf0ffe4

See more details on using hashes here.

File details

Details for the file alwayson_py-0.2.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for alwayson_py-0.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d623666b68f0ef1b7162e4ae2d52195e2a8dba9983f255b470f311baeb874178
MD5 8df4d45d6a1393ad405fe6fa420373a4
BLAKE2b-256 1d6e893c3f76bc994f0cfa119b5aea3e5f60a08a3f8a61c5ef293b64ddb38c6a

See more details on using hashes here.

File details

Details for the file alwayson_py-0.2.2-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for alwayson_py-0.2.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a7fa55ef1c0da1c632d133cc596ca55c98e1017421de0f7dfa2b1a5cf6cc2fae
MD5 38281fb0ad4e4c603c1e9560fc9a3203
BLAKE2b-256 0974b2bc10836ae8c2e548dd8dad213b44649d03bbd968bfbb4b94380f893eb7

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