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.1.tar.gz (57.0 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.1-cp312-cp312-win_amd64.whl (352.5 kB view details)

Uploaded CPython 3.12Windows x86-64

alwayson_py-0.3.1-cp312-cp312-manylinux_2_28_aarch64.whl (533.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

alwayson_py-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (542.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

alwayson_py-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (469.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

alwayson_py-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl (492.0 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for alwayson_py-0.3.1.tar.gz
Algorithm Hash digest
SHA256 931eb0110cd6bfdec0e43ab13dd419ba2ba5593a7365ab3c7cb0b33d50300604
MD5 e95afa533021564ab4a6f06ccc769e9a
BLAKE2b-256 5951f77b820a5c0ce80a7f5e54af3b87f88a32be570fbe94080aa5e0021c6f13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7837a746c5b58eadf040ba6ff7606491c391feefe1c3299e6e22653fd4d7579e
MD5 ac5c1715ac3c2b40f3aec9f8ff4dd2dd
BLAKE2b-256 ac22bad53523be21caec50aab8dbda062d879003fc6b926b61fc65157c34f6ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0127e3d7d36053e6b2af47b40dab13f51385e823d97fc5d5a3bfede44ddf5d46
MD5 42e4f6f322d5bf81b7b5bc2fadce32a2
BLAKE2b-256 caefb291085ca564c746ea16511e68776fa75e974e69f0dc10b4df4fdac46240

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5aff68f549c0c630373b5eb9c7f9acfdc38178cea7a9b83ed64b86410909bd8
MD5 ee7871ed550b45bbad2920e667cef5c5
BLAKE2b-256 f1677d9e08c2db563305f99d28197d9e0ec42d9a3a8fc3b54aa8a27ff5e494ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecf720c80c6e6f2e4272f0c50402bd8acd40e4e1c4eeb5fdb1e688c0ea9bbd43
MD5 155d2a9a68546ce2526ca17f899ecede
BLAKE2b-256 66b9feb5cdd7a19d9b10dea28e53f65bfaf2a3542bd128ace35cabf3725f06dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7e889cd3ffd38c176b097c53aee0bc174dfdc67b5930f18ec545207143270ca8
MD5 6d449bd4ac30f966269d1e94797372f1
BLAKE2b-256 fbd43b455c46a58be3e805b9af95718365ed32aaeb48e3b34bbe15ecab8d2aa7

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