Skip to main content

Embody Serial

PyPI Status Python Version License

Tests

pre-commit Black

Features

  • Connects to an EmBody device over the serial port
  • Uses the EmBody protocol to communicate with the device
  • Integrates with the EmBody Protocol Codec project
  • Asynchronous send without having to wait for response
  • Synchronous send where response message is returned
  • Send facade for protocol agnostic communication with device
  • Provides callback interfaces for incoming messages, response messages and connect/disconnect
  • All methods and callbacks are threadsafe
  • Separate threads for send, receive and callback processing
  • Type safe code using ty for type checking

Requirements

  • Python 3.12 or newer
  • Access to private Aidee Health repositories on Github

Installation

You can install Embody Serial via pip:

$ pip install embody-serial

This adds embody-serial as a library, but also provides the CLI application with the same name.

Usage

A very basic example where you send a message request and get a response:

from embodyserial.embodyserial import EmbodySerial
from embodyserial.helpers import EmbodySendHelper

embody_serial = EmbodySerial()
send_helper = EmbodySendHelper(sender=embody_serial)
print(f"Serial no: {send_helper.get_serial_no()}")
embody_serial.shutdown()

Logging

This library uses Python's standard logging module and follows best practices for libraries:

For Library Users

The library is silent by default - it won't produce any output unless you configure logging. To enable logging from the library:

import logging

# Enable INFO level logging for embodyserial
logging.getLogger('embodyserial').setLevel(logging.INFO)
logging.getLogger('embodyserial').addHandler(logging.StreamHandler())

# Or configure specific modules
logging.getLogger('embodyserial.embodyserial').setLevel(logging.DEBUG)

For CLI Users

The CLI configures logging automatically. Use --log-level to control verbosity:

embody-serial --get serialno --log-level DEBUG

Available levels: CRITICAL, WARNING, INFO, DEBUG (default: WARNING)

Using the application from the command line

The application also provides a CLI application that is automatically added to the path when installing via pip.

Once installed with pip, type:

embody-serial --help

To see which options are available.

Note The serial port is automatically detected, but can be overridden by using the --device option.

Example - List all attribute values

embody-serial --get-all

Example - Get serial no of device

embody-serial --get serialno

Example - List files over serial port

embody-serial --list-files

Example - Set time current time (UTC)

embody-serial --set-time

Example - Download files

embody-serial --download-files

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Troubleshooting

I get an error message saying 'no module named serial' or similar

This is a known issue and is usually caused by one of two things.

Ensure you haven't installed serial or jserial

Embody-serial uses the pyserial library. Run pip list to see if either the serial or jserial library is installed. If they are, remove them with pip uninstall serial.

Problems with pyserial

Sometimes, for whatever reason, it is necessary to re-install pyserial. Perform a pip uninstall pyserial and then pip install pyserial to see if this helps.

Metadata

Release files for embody-serial 1.0.39

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

Source distribution (sdist)

Source distribution for embody-serial 1.0.39
File Size Uploaded Provenance
embody_serial-1.0.39.tar.gz 16.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for embody-serial 1.0.39
File Interpreter ABI Platform
embody_serial-1.0.39-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / embody_serial-1.0.39.tar.gz

Download URL embody_serial-1.0.39.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a0cec90f9d863f8d4774f50fea7e59781df7d8592c93a319dfa612f754616bc4
BLAKE2b-256 checksum
How to use checksums
a47d8fd90c5ab8d63f511fd00d58c19e440ae09f58e48de7902d05a39e00afea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / embody_serial-1.0.39-py3-none-any.whl

Download URL embody_serial-1.0.39-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd51de740e36dc6cc7f9b344458a34003f74203cb534448efdd741ffe6837a8e
BLAKE2b-256 checksum
How to use checksums
266c3c075205ec6cbfeff82de8a51121353f58007b102b9660b4d326333cabc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Security for embody-serial 1.0.39

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.0.39 This release

2 release files No provenance

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