Skip to main content

Astarte message hub protocol buffers for Python

This module provides access to the Astarte message hub protocol buffers through a Python API.

Basic usage

Use pip to install the astarte-message-hub-proto package.

Then include and use it in your sources as follows:

from datetime import datetime, timezone
import grpc

from google.protobuf.timestamp_pb2 import Timestamp

from astarteplatform.msghub.message_hub_service_pb2_grpc import MessageHubStub
from astarteplatform.msghub.node_pb2 import Node
from astarteplatform.msghub.astarte_message_pb2 import AstarteMessage
from astarteplatform.msghub.astarte_type_pb2 import AstarteDataType, AstarteDataTypeIndividual

grpc_channel = grpc.insecure_channel("server address")
message_hub_stub = MessageHubStub(grpc_channel)

message_hub_node = Node(uuid="node uuid", interfaces_json=[b"interface 1 bin", b"interface 2 bin"])
message_hub_stream = message_hub_stub.Attach(message_hub_node)

# Transmit a very simple message
protobuf_value = AstarteDataType(astarte_individual=AstarteDataTypeIndividual(astarte_double=42.1))

protobuf_timestamp = Timestamp()
protobuf_timestamp.FromDatetime(datetime.now(tz=timezone.utc))

msg = AstarteMessage(
    'interface_name'="interface name",
    'path'="path",
    'timestamp'=protobuf_timestamp,
    'astarte_data'=protobuf_value)
message_hub_stub.Send(msg)

# Never ending receive loop
for astarte_message in message_hub_stream:
    # Parse astarte_message (AstarteMessage) as you see fit.
    print(astarte_message.interface_name)
    print(astarte_message.path)
    print(astarte_message.WhichOneof("payload"))

Metadata

Release files for astarte-message-hub-proto 0.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astarte-message-hub-proto 0.10.1
File Size Uploaded Provenance Actions
astarte_message_hub_proto-0.10.1.tar.gz 10.9 kB With provenance Details for astarte_message_hub_proto-0.10.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for astarte-message-hub-proto 0.10.1
File Interpreter ABI Platform Actions
astarte_message_hub_proto-0.10.1-py3-none-any.whl Python 3 none any Details for astarte_message_hub_proto-0.10.1-py3-none-any.whl

Total release size: 34.5 kB

Release files / astarte_message_hub_proto-0.10.1.tar.gz

Download URL astarte_message_hub_proto-0.10.1.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8fc76c9ba6937d1966ed5c159961df623b8ddae561b8f71e1fb89a66ca35f36d
BLAKE2b-256 checksum
How to use checksums
3ad40eaf6a5b6538b00c4a1108d383aabdb2801389d4f4258ea06c7f9449cf03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.

Transparency log

Release files / astarte_message_hub_proto-0.10.1-py3-none-any.whl

Download URL astarte_message_hub_proto-0.10.1-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b28b8016c32b8d4d1df8b0c34fd1995f834bb91a930b9c8e3ae6679935a20c3
BLAKE2b-256 checksum
How to use checksums
7ce97cbbb67e79e29facc77dfb13ba94d1e909787507ffb73198c1ed36c577be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.

Transparency log

Security for astarte-message-hub-proto 0.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for astarte_message_hub_proto-0.10.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page