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

Uploaded CPython 3.12Windows x86-64

alwayson_py-0.2.1-cp312-cp312-manylinux_2_28_aarch64.whl (530.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

alwayson_py-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (539.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

alwayson_py-0.2.1-cp312-cp312-macosx_11_0_arm64.whl (467.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

alwayson_py-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl (488.3 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for alwayson_py-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6354910ebe1ac133c6d2fabf473b0f51dbbc59ed26250439ef01f9125dc0f4c0
MD5 7fd4874225bba9fe381e7b013f8423b2
BLAKE2b-256 6dd6d1a3ad9b0d84ed6b210336d49f99f1ba83cbfd16cf7230ae767df6df4bac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f8a3c8af9a70899ab1dbb1f1737a72eab81e6188f10f1c6027feff31b90fc920
MD5 1fc573da4915c768680f0e1d36b152ae
BLAKE2b-256 216c67cfd9b678dc347e7509bdc64062d3f5512eef34353220fc7cd9877b5630

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.2.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9d3a989b19a8e9c0a19365e4a2cd8c4f7cf6fced71c0c2f0dda886c860ab15b5
MD5 c39dbbe869481f8f1c72ede8728e58c5
BLAKE2b-256 3d26b660b780694b89867491df9051726a01957f110f6d463eb84c6bd5873c1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 add2e4d82aedc01198f4f0034ee7d99947b0150771a4b659b67e09a8be098bed
MD5 da5427825ec108923fdff75847384db9
BLAKE2b-256 79b9bc34646d5c559930bb8880c227b4b4570f576cefd49a68181a042bce6c2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22d2db3a1844fc0eb365aeb29d5b2462cb4149aac01b4f80ce8b4389a063355c
MD5 5d1a0ee805f6d5044a1d2ceb09409813
BLAKE2b-256 34a9b83adda6f8bcbb34b5785a215872447be0e31dc3dc6999fa3c1bcba6604c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alwayson_py-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c8a42d980de9971d668f35bab10cbf81c06696c5d87af380e80f9ebe1a50bfe3
MD5 986220bfd869c6671536bb12eba7e8ed
BLAKE2b-256 9207643b10da5ab2397ccf15542677d6fd1814c8fbf21d61951ab89d20a378bf

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