Skip to main content

Ver/TestedPython Ver/Os
repo/Created Commit/Last Tests/GitHubWorkflowStatus Tests/GitHubWorkflowStatus
repo/Size Commit/Count/t Commit/Count/y Commit/Count/m

bus_user (current v0.4.16/Ver/Pypi Latest)

DESCRIPTION_SHORT

work with equipment over buses like Serial/i2c/... as client and server

DESCRIPTION_LONG

NOTE: IT SEEMS THIS IS OLD DATA! see tests for actual usage!

!. MOST APPROPRIATE COMMAND PROTOCOL other protocols mot recommended

  1. all cmds must be as params (preferred) in equipment or as special command
  2. [<CMD_NAME>] - read param value or run special command
    [IDN] - read value IDN
    [DUMP] - run special command
  3. [<CMD_NAME> ] - write value in parameter or run special cmd with param
    [VOUT 12.3] - set value into parameter VOUT
  4. [<CMD_NAME> ?] - get available values to write into parameter
    [MODE ?] - return [0 1 2 3]
  5. all command sent must return answer
    [OK] - if no value was asked [] - if asked some value, returned without measurement unit [FAIL] - any common not specified error [FAIL 0123] - any specified error without description [FAIL 02 VALUE OUT OF RANGE] - any specified error with description (full variant)

Features

  1. [SerialClient]:
    • keep all found ports in base class!
  2. Serial:
    • Client+Server
    • connect with Type__AddressAutoAcceptVariant FIRST_FREE/FIRST_FREE__ANSWER_VALID
    • set/get params by SlashOrSpacePath addressing
    • handle BackSpace send manually from terminal
  3. SerialServer values:
    • as Callable
    • ValueUnit
    • ValueVariants
    • list_results
  4. SerialServer cmd:
    • NONE is equivalent for SUCCESS
    • no need params (like line_parsed as before)
    • help - for show all variants (Units/Variants/Callables)!

License

See the LICENSE file for license rights and limitations (MIT).

Release history

See the HISTORY.md file for release history.

Installation

pip install bus-user

Import

from bus_user import *

USAGE EXAMPLES

See tests, sourcecode and docstrings for other examples.


1. example1.py

# NOTICE:
# 1. If bus cmd return several lines (DUMP for example) - you will get all of them in list! 
# 2. All answers you will get as string and you must parse it by youself!  
# errors will be get within it.


from bus_user import *

# SHOW (optional) COMMANDS EXPLICITLY by annotations without values!
# ------------------------------------------------------------------
class MySerialDevice(SerialClient):
    IDN: Callable[[Any], TYPE__RW_ANSWER]
    ADDR: Callable[[Any], TYPE__RW_ANSWER]
    DUMP: Callable[[Any], TYPE__RW_ANSWER]

# USE in code
# -----------
dev = MySerialDevice()
if dev.connect():
    answer1 = dev.IDN()   # return answer for sent string in port "IDN"
    answer2 = dev.VIN()   # return answer for sent string in port "VIN"
    answer3 = dev.VIN(12)   # return answer for sent string in port "VIN 12"
    answer4 = dev.VIN("12")   # return answer for sent string in port "VIN 12"

Metadata

Release files for bus-user 0.4.16

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

Source distribution (sdist)

Source distribution for bus-user 0.4.16
File Size Uploaded Provenance Actions
bus_user-0.4.16.tar.gz 31.4 kB Without provenance Details for bus_user-0.4.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bus-user 0.4.16
File Interpreter ABI Platform Actions
bus_user-0.4.16-py3-none-any.whl Python 3 none any Details for bus_user-0.4.16-py3-none-any.whl

Total release size: 56.2 kB

Release files / bus_user-0.4.16.tar.gz

Download URL bus_user-0.4.16.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4403e3d7296e5c13ebee09f3eef495c4d14dbf63d5ccc0f3c5c6113715169e02
BLAKE2b-256 checksum
How to use checksums
279b2b95adb4bf0cf4dcb7eb044f02791af3dd4144f13c0b8c45741521632a11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / bus_user-0.4.16-py3-none-any.whl

Download URL bus_user-0.4.16-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adcdd55e047d968fa880700fbdc73784330c0ce5988941b21cd40077a1409d07
BLAKE2b-256 checksum
How to use checksums
e2220cf411dd6bb3744ef6a743f715888a696f3476cc71a8fc3f8b1f22ced72b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for bus-user 0.4.16

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

0.4.16 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