Skip to main content

python-can backend for can-hub: remote CAN interfaces over unix/tcp/tls/quic

Project description

python-can-hub

Native python-can backend for can-hub: consume remote CAN interfaces exported by can-hub agents, directly over the binary protocol — unix socket, plain TCP, TLS or QUIC, with mTLS identity and TOFU pinning on the encrypted transports. No bridge process in between.

import can

bus = can.Bus(
    interface="canhub",
    channel="truck42/can0",
    url="quic://hub.example.com:7227",
)
bus.send(can.Message(arbitration_id=0x123, data=b"\xDE\xAD\xBE\xEF"))
for message in bus:
    print(message)
  • channel: namespaced interface agent/iface (or the numeric id from can-hub-client list).
  • url: omit to connect to the local hub unix socket.
  • state_dir: client TLS identity + pin store location (tls/quic).
  • receive_own_messages: standard python-can echo semantics.

Write access follows the hub client ACLs: if the ACL grants read-only, the bus opens read-only and send() raises.

The wheel bundles libcanhub.so with the TLS/QUIC stack linked in statically; the only runtime dependency is glibc.

Building from source

./scripts/build-python-wheel.sh        # host arch, glibc-tagged (local dev)
pip install python/dist/*.whl

Distributable manylinux wheels are built per architecture in a manylinux container and repaired by auditwheel (needs docker, plus QEMU binfmt for the cross arches):

./scripts/build-python-wheel.sh x86_64   # python/dist/x86_64/*.whl
./scripts/build-python-wheel.sh aarch64
./scripts/build-python-wheel.sh armv7l

The release workflow builds all three and publishes them to PyPI on a v* tag.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

python_can_hub-0.2.2-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

python_can_hub-0.2.2-py3-none-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARMv7lmanylinux: glibc 2.31+ ARMv7l

python_can_hub-0.2.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.26+ x86-64manylinux: glibc 2.28+ x86-64

python_can_hub-0.2.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

File details

Details for the file python_can_hub-0.2.2-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for python_can_hub-0.2.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9f937f32992ebe8a3e1b3dbce250d71bce34e604adfd86faee88790947bb65fd
MD5 f4bb7544ef199f279c7d0e6cf301438c
BLAKE2b-256 3be06617193de331e8eb6f68b55d6b210e299728a61efb0cb0b338a45db2a7a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_can_hub-0.2.2-py3-none-win_amd64.whl:

Publisher: release.yml on can-hub-io/can-hub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_can_hub-0.2.2-py3-none-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl.

File metadata

File hashes

Hashes for python_can_hub-0.2.2-py3-none-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl
Algorithm Hash digest
SHA256 0b5b70bcff427de17695726f5b174cd9d5966ca6c5e581859b2b23d0cad3f1fc
MD5 5eb9b91a7fbc02f31d82f039086b44b3
BLAKE2b-256 4e4b8ef1cd4fadebbe1a36ce303c7cf47ffeb06319cb96a75b9ff08d7430e317

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_can_hub-0.2.2-py3-none-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl:

Publisher: release.yml on can-hub-io/can-hub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_can_hub-0.2.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_can_hub-0.2.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f36442bc07db69260435bb4aeb8787c8d9cd5802bb30492b297e90a71df1b461
MD5 533246a1c1ffe64added9bee866c8348
BLAKE2b-256 09d9969f4a15e510b8a0853984ddd2c387df3237ea6af92f78e674aa7189b63f

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_can_hub-0.2.2-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on can-hub-io/can-hub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_can_hub-0.2.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for python_can_hub-0.2.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d5444cb5e88f8f57b8abbc5c82a09029db7a2df4922d45c8a9e1c151e0b2f7d9
MD5 0ce0b3b44daf2507076491047e113c03
BLAKE2b-256 5bcef55dc5b0ce5533f60b96c3c346c50306190d0d25f85666510d91ea53aef9

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_can_hub-0.2.2-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on can-hub-io/can-hub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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