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.1.0.tar.gz (42.7 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.1.0-cp312-cp312-win_amd64.whl (174.7 kB view details)

Uploaded CPython 3.12Windows x86-64

alwayson_py-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl (320.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

alwayson_py-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (319.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

alwayson_py-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (279.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

alwayson_py-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl (284.3 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for alwayson_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 952a57fb7209020e5a778d26d6259feea9a1f85ef31ecfc55719bf2d55e750dc
MD5 b04c87f0dcb435945cfccd1857f64edc
BLAKE2b-256 51075d546987679c87f26d1c9769189f450e5fa6c5e0c348f3ab2b00493d3755

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a0caeccc7492a96dcdf6a8122cd7c83789e0677295aa8073ffad7a00dc5692ec
MD5 2a148f25432a417b36ed05663e8040ee
BLAKE2b-256 dd91792925c7bef6ac31ba60edf2567b734e7caf29e09ea25d85dc33742b4f97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4faf4cbbd5e42e150af7ab635d3187d62739d6313f4acb356fa143c32189f483
MD5 a357df8f955ad04474913252f98c37df
BLAKE2b-256 87abb830daeb648d965f57c99669c2dae2bc61bd07accc5cc0c8553dba17f961

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbdbdac5e43add255dd452d584d260587b0869ca56bd81700fbbbaedcce70226
MD5 6aea168a568f786f0df24d1db49e8f69
BLAKE2b-256 fe607e26038243fbea9be62bca25629e41d93bb70a49679c9f4b6072b8284ac1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd7982365ca5649cb02d9d90a463119caaa03b358f832306aa64a94af5e3f61c
MD5 2c4c1de8ee9719fc0cc12e8a72af5ba5
BLAKE2b-256 c0ddc2785146ba02710d600a68d1120858de0c5ce6a4bd226af26f61f0df3ef9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6d393bfad70e7770bf9e4906c76465afc9e11c67c6109dbbbc1657796a0308e2
MD5 f8a005b82fce6a3c54396d54dc4e146a
BLAKE2b-256 4ec83e91953d785d99be5b9665f9b4ec30a07e63999a4e18d50d8cb38854f545

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