bus-user


Namebus-user JSON
Version 0.4.16 PyPI version JSON
download
home_pagehttps://github.com/centroid457/
Summarywork with equipment over buses like Serial/i2c/... as client and server
upload_time2024-10-01 14:59:39
maintainerNone
docs_urlNone
authorAndrei Starichenko
requires_python>=3.6
licenseNone
keywords serial serial bus pyserial serial port com port comport rs232 uart ttl serial client serial server serial emulator i2c
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Ver/TestedPython](https://img.shields.io/pypi/pyversions/bus_user)
![Ver/Os](https://img.shields.io/badge/os_development-Windows-blue)  
![repo/Created](https://img.shields.io/github/created-at/centroid457/bus_user)
![Commit/Last](https://img.shields.io/github/last-commit/centroid457/bus_user)
![Tests/GitHubWorkflowStatus](https://github.com/centroid457/bus_user/actions/workflows/test_linux.yml/badge.svg)
![Tests/GitHubWorkflowStatus](https://github.com/centroid457/bus_user/actions/workflows/test_windows.yml/badge.svg)  
![repo/Size](https://img.shields.io/github/repo-size/centroid457/bus_user)
![Commit/Count/t](https://img.shields.io/github/commit-activity/t/centroid457/bus_user)
![Commit/Count/y](https://img.shields.io/github/commit-activity/y/centroid457/bus_user)
![Commit/Count/m](https://img.shields.io/github/commit-activity/m/centroid457/bus_user)

# bus_user (current v0.4.16/![Ver/Pypi Latest](https://img.shields.io/pypi/v/bus_user?label=pypi%20latest))

## 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> <VALUE>] - 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
    [<VALUE>] - 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](LICENSE) file for license rights and limitations (MIT).


## Release history
See the [HISTORY.md](HISTORY.md) file for release history.


## Installation
```commandline
pip install bus-user
```


## Import
```python
from bus_user import *
```


********************************************************************************
## USAGE EXAMPLES
See tests, sourcecode and docstrings for other examples.  

------------------------------
### 1. example1.py
```python
# 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"
```

********************************************************************************

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/centroid457/",
    "name": "bus-user",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "serial, serial bus, pyserial, serial port, com port, comport, rs232, UART, TTL, serial client, serial server, serial emulator, i2c",
    "author": "Andrei Starichenko",
    "author_email": "centroid@mail.ru",
    "download_url": "https://files.pythonhosted.org/packages/27/9b/2b95adb4bf0cf4dcb7eb044f02791af3dd4144f13c0b8c45741521632a11/bus_user-0.4.16.tar.gz",
    "platform": null,
    "description": "![Ver/TestedPython](https://img.shields.io/pypi/pyversions/bus_user)\r\n![Ver/Os](https://img.shields.io/badge/os_development-Windows-blue)  \r\n![repo/Created](https://img.shields.io/github/created-at/centroid457/bus_user)\r\n![Commit/Last](https://img.shields.io/github/last-commit/centroid457/bus_user)\r\n![Tests/GitHubWorkflowStatus](https://github.com/centroid457/bus_user/actions/workflows/test_linux.yml/badge.svg)\r\n![Tests/GitHubWorkflowStatus](https://github.com/centroid457/bus_user/actions/workflows/test_windows.yml/badge.svg)  \r\n![repo/Size](https://img.shields.io/github/repo-size/centroid457/bus_user)\r\n![Commit/Count/t](https://img.shields.io/github/commit-activity/t/centroid457/bus_user)\r\n![Commit/Count/y](https://img.shields.io/github/commit-activity/y/centroid457/bus_user)\r\n![Commit/Count/m](https://img.shields.io/github/commit-activity/m/centroid457/bus_user)\r\n\r\n# bus_user (current v0.4.16/![Ver/Pypi Latest](https://img.shields.io/pypi/v/bus_user?label=pypi%20latest))\r\n\r\n## DESCRIPTION_SHORT\r\nwork with equipment over buses like Serial/i2c/... as client and server\r\n\r\n## DESCRIPTION_LONG\r\n###\r\nNOTE: IT SEEMS THIS IS OLD DATA! see tests for actual usage!\r\n    \r\n!. MOST APPROPRIATE COMMAND PROTOCOL\r\nother protocols mot recommended\r\n\r\n1. all cmds must be as params (preferred) in equipment or as special command\r\n2. [<CMD_NAME>] - read param value or run special command  \r\n    [IDN] - read value IDN  \r\n    [DUMP] - run special command \r\n3. [<CMD_NAME> <VALUE>] - write value in parameter or run special cmd with param  \r\n    [VOUT 12.3] - set value into parameter VOUT  \r\n4. [<CMD_NAME> ?] - get available values to write into parameter  \r\n    [MODE ?] - return [0 1 2 3]\r\n5. all command sent must return answer  \r\n    [OK] - if no value was asked\r\n    [<VALUE>] - if asked some value, returned without measurement unit\r\n    [FAIL] - any common not specified error\r\n    [FAIL 0123] - any specified error without description\r\n    [FAIL 02 VALUE OUT OF RANGE] - any specified error with description (full variant)\r\n\r\n\r\n## Features\r\n1. [SerialClient]:  \r\n\t- keep all found ports in base class!  \r\n2. Serial:  \r\n\t- Client+Server  \r\n\t- connect with Type__AddressAutoAcceptVariant FIRST_FREE/FIRST_FREE__ANSWER_VALID  \r\n\t- set/get params by SlashOrSpacePath addressing  \r\n\t- handle BackSpace send manually from terminal  \r\n3. SerialServer values:  \r\n\t- as Callable  \r\n\t- ValueUnit  \r\n\t- ValueVariants  \r\n\t- list_results  \r\n4. SerialServer cmd:  \r\n\t- NONE is equivalent for SUCCESS  \r\n\t- no need params (like line_parsed as before)  \r\n\t- help - for show all variants (Units/Variants/Callables)!  \r\n\r\n\r\n********************************************************************************\r\n## License\r\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).\r\n\r\n\r\n## Release history\r\nSee the [HISTORY.md](HISTORY.md) file for release history.\r\n\r\n\r\n## Installation\r\n```commandline\r\npip install bus-user\r\n```\r\n\r\n\r\n## Import\r\n```python\r\nfrom bus_user import *\r\n```\r\n\r\n\r\n********************************************************************************\r\n## USAGE EXAMPLES\r\nSee tests, sourcecode and docstrings for other examples.  \r\n\r\n------------------------------\r\n### 1. example1.py\r\n```python\r\n# NOTICE:\r\n# 1. If bus cmd return several lines (DUMP for example) - you will get all of them in list! \r\n# 2. All answers you will get as string and you must parse it by youself!  \r\n# errors will be get within it.\r\n\r\n\r\nfrom bus_user import *\r\n\r\n# SHOW (optional) COMMANDS EXPLICITLY by annotations without values!\r\n# ------------------------------------------------------------------\r\nclass MySerialDevice(SerialClient):\r\n    IDN: Callable[[Any], TYPE__RW_ANSWER]\r\n    ADDR: Callable[[Any], TYPE__RW_ANSWER]\r\n    DUMP: Callable[[Any], TYPE__RW_ANSWER]\r\n\r\n# USE in code\r\n# -----------\r\ndev = MySerialDevice()\r\nif dev.connect():\r\n    answer1 = dev.IDN()   # return answer for sent string in port \"IDN\"\r\n    answer2 = dev.VIN()   # return answer for sent string in port \"VIN\"\r\n    answer3 = dev.VIN(12)   # return answer for sent string in port \"VIN 12\"\r\n    answer4 = dev.VIN(\"12\")   # return answer for sent string in port \"VIN 12\"\r\n```\r\n\r\n********************************************************************************\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "work with equipment over buses like Serial/i2c/... as client and server",
    "version": "0.4.16",
    "project_urls": {
        "Homepage": "https://github.com/centroid457/",
        "Source": "https://github.com/centroid457/bus_user"
    },
    "split_keywords": [
        "serial",
        " serial bus",
        " pyserial",
        " serial port",
        " com port",
        " comport",
        " rs232",
        " uart",
        " ttl",
        " serial client",
        " serial server",
        " serial emulator",
        " i2c"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2220cf411dd6bb3744ef6a743f715888a696f3476cc71a8fc3f8b1f22ced72b",
                "md5": "e0b58861add8584a9f49080f97401813",
                "sha256": "adcdd55e047d968fa880700fbdc73784330c0ce5988941b21cd40077a1409d07"
            },
            "downloads": -1,
            "filename": "bus_user-0.4.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e0b58861add8584a9f49080f97401813",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 24750,
            "upload_time": "2024-10-01T14:59:38",
            "upload_time_iso_8601": "2024-10-01T14:59:38.030280Z",
            "url": "https://files.pythonhosted.org/packages/e2/22/0cf411dd6bb3744ef6a743f715888a696f3476cc71a8fc3f8b1f22ced72b/bus_user-0.4.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "279b2b95adb4bf0cf4dcb7eb044f02791af3dd4144f13c0b8c45741521632a11",
                "md5": "23bfe0c44c5d568b6a58508510968f5f",
                "sha256": "4403e3d7296e5c13ebee09f3eef495c4d14dbf63d5ccc0f3c5c6113715169e02"
            },
            "downloads": -1,
            "filename": "bus_user-0.4.16.tar.gz",
            "has_sig": false,
            "md5_digest": "23bfe0c44c5d568b6a58508510968f5f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 31436,
            "upload_time": "2024-10-01T14:59:39",
            "upload_time_iso_8601": "2024-10-01T14:59:39.437860Z",
            "url": "https://files.pythonhosted.org/packages/27/9b/2b95adb4bf0cf4dcb7eb044f02791af3dd4144f13c0b8c45741521632a11/bus_user-0.4.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-01 14:59:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "centroid457",
    "github_project": "bus_user",
    "github_not_found": true,
    "lcname": "bus-user"
}
        
Elapsed time: 1.14266s