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.3.0.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.3.0-cp312-cp312-win_amd64.whl (350.1 kB view details)

Uploaded CPython 3.12Windows x86-64

alwayson_py-0.3.0-cp312-cp312-manylinux_2_28_aarch64.whl (531.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

alwayson_py-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (540.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

alwayson_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (467.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

alwayson_py-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl (489.3 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: alwayson_py-0.3.0.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.3.0.tar.gz
Algorithm Hash digest
SHA256 a9d629dcad1a4bd434c0e19f09aa0e3e0d1204a808e5902de307f9c89f73ba3d
MD5 07f5bb0d59182616003a28c48aae0076
BLAKE2b-256 1b19f5d6870df897be8e65c44d3e4404219e62538d705022ed3584d5f00d88c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 032c64384c9f9fe6bb04062d1703816036a3c34bbd0827ede5bf8e975c25fed3
MD5 222c28497b107bed945a53745b67230a
BLAKE2b-256 69e64618c4eb1229aff4475428fcd585b721145b575197e51b67a332239cb736

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 53fc55ff91a6db8b802ff80785a1c6976a8e4689368d31dd86c3d23cd09273e4
MD5 94daa9f21f86e198ca6c1275e9197d65
BLAKE2b-256 36c4e98edb561c5014b8d3d127532f880f6cb1350803d5ed573313da2cf6e94e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7cc552007d943abd0ca48183a0d9f67dac41b3d91fb2105eea5eca52cbf96645
MD5 38bf528740592675c95f0a5a3d51eb32
BLAKE2b-256 f0b84917a4c36b083c975ce7e76f2d3a8296e658b3f2fb39053c27799d788872

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85ce40e9dfb060b1e5450f2bbb88d6be9dc2e9272837abfa5e1075fdd94547ce
MD5 0012b784060ff3fe6423b5297b091dfb
BLAKE2b-256 dbdd87ffeb2dab98f5eccf14b707f62c5b64523c728acb531ada5b74190a158e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b67717527dd603b17d9a1bf48c753b12d4d7d985c604f3f8a13f5866f8e2879f
MD5 4fe3029bbddca37d21ecf35f5bb8cb28
BLAKE2b-256 90736a3deb496130162e58389855df372073b77afed22865d122678b4782853e

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