aj090-hw-tools 0.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,174 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
@@ -0,0 +1,11 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
4
+ !_TAG_OUTPUT_FILESEP slash /slash or backslash/
5
+ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
6
+ !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
7
+ !_TAG_PROC_CWD /home/vasen/Software/esp/aj090-hw-tools/ //
8
+ !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
9
+ !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
10
+ !_TAG_PROGRAM_URL https://ctags.io/ /official site/
11
+ !_TAG_PROGRAM_VERSION 5.9.0 //
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-present Vasencheg <vasencheg@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: aj090-hw-tools
3
+ Version: 0.0.9
4
+ Project-URL: Documentation, https://github.com/Vasencheg/aj090-hw-tools#readme
5
+ Project-URL: Issues, https://github.com/Vasencheg/aj090-hw-tools/issues
6
+ Project-URL: Source, https://github.com/Vasencheg/aj090-hw-tools
7
+ Author-email: Vasencheg <vasencheg@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE.txt
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: Implementation :: CPython
16
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: aioconsole>=0.8.1
19
+ Requires-Dist: aiofile>=3.9.0
20
+ Requires-Dist: aiohttp>=3.11.14
21
+ Requires-Dist: colorama>=0.4.6
22
+ Requires-Dist: configargparse>=1.7
23
+ Requires-Dist: esp-idf-nvs-partition-gen>=0.1.8
24
+ Requires-Dist: esptool==4.8.1
25
+ Requires-Dist: numpy>=2.2.4
26
+ Requires-Dist: pexpect>=4.9.0
27
+ Requires-Dist: pyserial>=3.5
28
+ Requires-Dist: rich>=14.0.0
29
+ Description-Content-Type: text/markdown
30
+
31
+ # aj090_hw_tools
32
+
33
+ [![PyPI - Version](https://img.shields.io/pypi/v/aj090-hw-tools.svg)](https://pypi.org/project/aj090-hw-tools)
34
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aj090-hw-tools.svg)](https://pypi.org/project/aj090-hw-tools)
35
+
36
+ -----
37
+
38
+ ## Table of Contents
39
+
40
+ - [Installation](#installation)
41
+ - [License](#license)
42
+
43
+ ## Installation
44
+
45
+ ```console
46
+ pip install aj090-hw-tools
47
+ ```
48
+
49
+ ## License
50
+
51
+ `aj090-hw-tools` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -0,0 +1,21 @@
1
+ # aj090_hw_tools
2
+
3
+ [![PyPI - Version](https://img.shields.io/pypi/v/aj090-hw-tools.svg)](https://pypi.org/project/aj090-hw-tools)
4
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aj090-hw-tools.svg)](https://pypi.org/project/aj090-hw-tools)
5
+
6
+ -----
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [License](#license)
12
+
13
+ ## Installation
14
+
15
+ ```console
16
+ pip install aj090-hw-tools
17
+ ```
18
+
19
+ ## License
20
+
21
+ `aj090-hw-tools` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -0,0 +1,77 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "aj090-hw-tools"
7
+ dynamic = ["version"]
8
+ description = ''
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ keywords = []
13
+ authors = [
14
+ { name = "Vasencheg", email = "vasencheg@gmail.com" },
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Programming Language :: Python",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: Implementation :: CPython",
23
+ "Programming Language :: Python :: Implementation :: PyPy",
24
+ ]
25
+ dependencies = [
26
+ "pyserial>=3.5",
27
+ "esptool==4.8.1",
28
+ "esp-idf-nvs-partition-gen>=0.1.8",
29
+ "pexpect>=4.9.0",
30
+ "configargparse>=1.7",
31
+ "aiohttp>=3.11.14",
32
+ "aiofile>=3.9.0",
33
+ "aioconsole>=0.8.1",
34
+ "numpy>=2.2.4",
35
+ "colorama>=0.4.6",
36
+ "rich>=14.0.0"
37
+ ]
38
+
39
+ [project.urls]
40
+ Documentation = "https://github.com/Vasencheg/aj090-hw-tools#readme"
41
+ Issues = "https://github.com/Vasencheg/aj090-hw-tools/issues"
42
+ Source = "https://github.com/Vasencheg/aj090-hw-tools"
43
+
44
+ [tool.hatch.version]
45
+ path = "src/aj090_hw_tools/__about__.py"
46
+
47
+ [tool.hatch.envs.types]
48
+ extra-dependencies = [
49
+ "mypy>=1.0.0",
50
+ ]
51
+ [tool.hatch.envs.types.scripts]
52
+ check = "mypy --install-types --non-interactive {args:src/aj090_hw_tools tests}"
53
+
54
+ [tool.coverage.run]
55
+ source_pkgs = ["aj090_hw_tools", "tests"]
56
+ branch = true
57
+ parallel = true
58
+ omit = [
59
+ "src/aj090_hw_tools/__about__.py",
60
+ ]
61
+
62
+ [tool.coverage.paths]
63
+ aj090_hw_tools = ["src/aj090_hw_tools", "*/aj090-hw-tools/src/aj090_hw_tools"]
64
+ tests = ["tests", "*/aj090-hw-tools/tests"]
65
+
66
+ [tool.coverage.report]
67
+ exclude_lines = [
68
+ "no cov",
69
+ "if __name__ == .__main__.:",
70
+ "if TYPE_CHECKING:",
71
+ ]
72
+
73
+ [tool.hatch.envs.default]
74
+ system-packages = true
75
+
76
+ [project.scripts]
77
+ aj090-hw-tools = 'aj090_hw_tools.__main__:script_ep'
@@ -0,0 +1 @@
1
+ __version__ = "0.0.9"
@@ -0,0 +1,81 @@
1
+ __all__ = [
2
+ "hw_tools"
3
+ ]
4
+
5
+ import sys
6
+ import configargparse
7
+
8
+ from .__about__ import __version__
9
+ from .tools import (
10
+ firmware,
11
+ test,
12
+ info,
13
+ serial,
14
+ loadcell
15
+ )
16
+
17
+ def hw_tools():
18
+ parser = configargparse.ArgParser(
19
+ description="aj090-hw-tools.py v%s - AJ090 hardware tools"
20
+ % __version__,
21
+ prog="aj090-hw-tools",
22
+ )
23
+
24
+ parser.add_argument(
25
+ "--port",
26
+ "-p",
27
+ help="Serial port device",
28
+ env_var="AJ090_HW_PORT",
29
+ )
30
+
31
+ parser.add_argument('-c', '--config', is_config_file=True, help='config file path')
32
+
33
+ parser.add_argument('device', type=str, choices=['cell', 'shelf'], help='device')
34
+
35
+ subparsers = parser.add_subparsers(title='Device tools', dest='tools', help='Run aj090-hw-tools {device} {tool} -h for additional help')
36
+
37
+ # Firmware operations
38
+ parser_firmware = subparsers.add_parser('firmware', help='device firmware operations group')
39
+ parser_firmware.set_defaults(func=firmware)
40
+ parser_firmware.add_argument('operation', type=str, choices=['write', 'erase'], help='firmware operations')
41
+ parser_firmware.add_argument('-f', '--bin_file', type=str, help='firmware bin file')
42
+
43
+ # Info
44
+ parser_info = subparsers.add_parser('info', help='display detailed information about the device')
45
+ parser_info.set_defaults(func=info)
46
+
47
+ # Test
48
+ parser_test = subparsers.add_parser('test', help='perform hardware tests on the device')
49
+ parser_test.set_defaults(func=test)
50
+
51
+ # Serial
52
+ parser_serial = subparsers.add_parser('serial', help='read or write device serial number')
53
+ parser_serial.set_defaults(func=serial)
54
+ parser_serial.add_argument('operation', type=str, choices=['write', 'read'], help='serial operations')
55
+ parser_serial.add_argument('-s', '--serial', type=str, required='write' in sys.argv, help='serial number')
56
+
57
+ # Loadcell
58
+ parser_loadcell = subparsers.add_parser('loadcell', help='perform loadcell test or display live readings')
59
+ parser_loadcell.set_defaults(func=loadcell)
60
+ parser_loadcell.add_argument('operation', type=str, choices=['test', 'show'], help='loadcell operations')
61
+
62
+ # Factory
63
+ # parser_factory = subparsers.add_parser('factory_mode', help='device factory mode control')
64
+
65
+ if len(sys.argv) <= 1:
66
+ parser.print_help()
67
+ sys.exit(-1)
68
+
69
+ args = parser.parse_args()
70
+
71
+ try:
72
+ return args.func(args)
73
+ except KeyboardInterrupt:
74
+ sys.exit(-1)
75
+
76
+ if __name__ == '__main__':
77
+ try:
78
+ sys.exit(hw_tools())
79
+ except Exception as ex:
80
+ print(ex)
81
+ sys.exit(-1)
@@ -0,0 +1,13 @@
1
+ from aj090_hw_tools import hw_tools
2
+
3
+ def script_ep():
4
+ """
5
+ Entry point for running the aj090_hw_tools script.
6
+ """
7
+ try:
8
+ hw_tools()
9
+ except Exception as e:
10
+ print(f"An error occurred: {e}")
11
+
12
+ if __name__ == '__main__':
13
+ script_ep()
@@ -0,0 +1,2 @@
1
+ SERIAL_NUM_PATTERN = r'\w\d{10}'
2
+ SERIAL_INPUT_PATTERN = r'\d{10}'
@@ -0,0 +1,13 @@
1
+ __all__ = [
2
+ "firmware",
3
+ "test",
4
+ "info",
5
+ "serial",
6
+ "loadcell",
7
+ ]
8
+
9
+ from .firmware import firmware
10
+ from .test import test
11
+ from .info import info
12
+ from .serial_number import serial
13
+ from .loadcell import loadcell