seaf-helper-tools 0.1.0__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.
- seaf_helper_tools-0.1.0/LICENSE +15 -0
- seaf_helper_tools-0.1.0/PKG-INFO +109 -0
- seaf_helper_tools-0.1.0/README.md +57 -0
- seaf_helper_tools-0.1.0/pyproject.toml +77 -0
- seaf_helper_tools-0.1.0/setup.cfg +4 -0
- seaf_helper_tools-0.1.0/src/helper_commands/__init__.py +3 -0
- seaf_helper_tools-0.1.0/src/helper_commands/__main__.py +6 -0
- seaf_helper_tools-0.1.0/src/helper_commands/cli.py +39 -0
- seaf_helper_tools-0.1.0/src/helper_commands/commands/__init__.py +0 -0
- seaf_helper_tools-0.1.0/src/helper_commands/commands/assessment_xls2yaml.py +537 -0
- seaf_helper_tools-0.1.0/src/helper_commands/commands/assessment_yaml2xls.py +351 -0
- seaf_helper_tools-0.1.0/src/helper_commands/core/__init__.py +1 -0
- seaf_helper_tools-0.1.0/src/helper_commands/core/config.py +150 -0
- seaf_helper_tools-0.1.0/src/helper_commands/utils/__init__.py +0 -0
- seaf_helper_tools-0.1.0/src/helper_commands/utils/jsonata.py +97 -0
- seaf_helper_tools-0.1.0/src/helper_commands/utils/nsi.py +109 -0
- seaf_helper_tools-0.1.0/src/helper_commands/utils/secured_api.py +228 -0
- seaf_helper_tools-0.1.0/src/helper_commands/utils/xls_utils.py +45 -0
- seaf_helper_tools-0.1.0/src/helper_commands/utils/yaml_utils.py +80 -0
- seaf_helper_tools-0.1.0/src/seaf_helper_tools.egg-info/PKG-INFO +109 -0
- seaf_helper_tools-0.1.0/src/seaf_helper_tools.egg-info/SOURCES.txt +32 -0
- seaf_helper_tools-0.1.0/src/seaf_helper_tools.egg-info/dependency_links.txt +1 -0
- seaf_helper_tools-0.1.0/src/seaf_helper_tools.egg-info/entry_points.txt +2 -0
- seaf_helper_tools-0.1.0/src/seaf_helper_tools.egg-info/requires.txt +15 -0
- seaf_helper_tools-0.1.0/src/seaf_helper_tools.egg-info/top_level.txt +1 -0
- seaf_helper_tools-0.1.0/tests/test_assessment_xls2yaml.py +420 -0
- seaf_helper_tools-0.1.0/tests/test_assessment_yaml2xls.py +267 -0
- seaf_helper_tools-0.1.0/tests/test_cli.py +20 -0
- seaf_helper_tools-0.1.0/tests/test_config.py +140 -0
- seaf_helper_tools-0.1.0/tests/test_jsonata.py +106 -0
- seaf_helper_tools-0.1.0/tests/test_nsi.py +137 -0
- seaf_helper_tools-0.1.0/tests/test_secured_api.py +133 -0
- seaf_helper_tools-0.1.0/tests/test_xls_utils.py +131 -0
- seaf_helper_tools-0.1.0/tests/test_yaml_utils.py +75 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
seaf-helper-tools — CLI tools for working with SEAF assessment data
|
|
2
|
+
Copyright (C) 2024 Alexandr Latushkin
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU General Public License as published by
|
|
6
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
7
|
+
(at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License
|
|
15
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: seaf-helper-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI tools for working with SEAF assessment data: YAML/XLS conversion, standards surveys, remote NSI sources.
|
|
5
|
+
Author: Alexandr Latushkin
|
|
6
|
+
License: seaf-helper-tools — CLI tools for working with SEAF assessment data
|
|
7
|
+
Copyright (C) 2024 Alexandr Latushkin
|
|
8
|
+
|
|
9
|
+
This program is free software: you can redistribute it and/or modify
|
|
10
|
+
it under the terms of the GNU General Public License as published by
|
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
(at your option) any later version.
|
|
13
|
+
|
|
14
|
+
This program is distributed in the hope that it will be useful,
|
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
GNU General Public License for more details.
|
|
18
|
+
|
|
19
|
+
You should have received a copy of the GNU General Public License
|
|
20
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
21
|
+
|
|
22
|
+
Project-URL: Repository, https://gitverse.ru/alex314/helper_commands
|
|
23
|
+
Keywords: seaf,assessment,yaml,xls,cli
|
|
24
|
+
Classifier: Development Status :: 4 - Beta
|
|
25
|
+
Classifier: Intended Audience :: Developers
|
|
26
|
+
Classifier: Intended Audience :: System Administrators
|
|
27
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
28
|
+
Classifier: Programming Language :: Python :: 3
|
|
29
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
30
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
31
|
+
Classifier: Operating System :: OS Independent
|
|
32
|
+
Classifier: Environment :: Console
|
|
33
|
+
Classifier: Topic :: Utilities
|
|
34
|
+
Requires-Python: >=3.11
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
License-File: LICENSE
|
|
37
|
+
Requires-Dist: typer>=0.9.0
|
|
38
|
+
Requires-Dist: rich>=13.0
|
|
39
|
+
Requires-Dist: openpyxl>=3.1
|
|
40
|
+
Requires-Dist: ruamel.yaml>=0.18
|
|
41
|
+
Requires-Dist: requests>=2.31
|
|
42
|
+
Requires-Dist: urllib3>=2.0
|
|
43
|
+
Provides-Extra: dev
|
|
44
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
45
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
46
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
47
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
48
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
49
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
50
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
51
|
+
Dynamic: license-file
|
|
52
|
+
|
|
53
|
+
# seaf-helper-tools
|
|
54
|
+
|
|
55
|
+
CLI-инструменты для работы с данными SEAF: конвертация анкет объектов оценки между форматами YAML и XLS, поддержка удалённых источников НСИ через JSONata API.
|
|
56
|
+
|
|
57
|
+
## Установка
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install seaf-helper-tools
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Команды
|
|
64
|
+
|
|
65
|
+
| Команда | Описание |
|
|
66
|
+
|---------|----------|
|
|
67
|
+
| `survey-standards-yaml2xls` | Конвертировать YAML-анкету объекта оценки в XLS |
|
|
68
|
+
| `survey-standards-xls2yaml` | Конвертировать XLS-анкету обратно в YAML |
|
|
69
|
+
|
|
70
|
+
### Примеры
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Сгенерировать XLS из YAML
|
|
74
|
+
seaf-helper-tools survey-standards-yaml2xls input.yaml output.xlsx --template template.xlsx
|
|
75
|
+
|
|
76
|
+
# Конвертировать XLS обратно в YAML
|
|
77
|
+
seaf-helper-tools survey-standards-xls2yaml input.xlsx output.yaml
|
|
78
|
+
|
|
79
|
+
# С конфигурационным файлом (для подключения к API)
|
|
80
|
+
seaf-helper-tools --config config.yaml survey-standards-yaml2xls input.yaml output.xlsx
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Конфигурация
|
|
84
|
+
|
|
85
|
+
Для подключения к удалённому API NSI создайте `config.yaml` по образцу `config.example.yaml`:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
api:
|
|
89
|
+
url: https://your-seaf-instance/api
|
|
90
|
+
cert: /path/to/client.crt
|
|
91
|
+
key: /path/to/client.key
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Разработка
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://gitverse.ru/alex314/helper_commands
|
|
98
|
+
cd seaf-helper-tools
|
|
99
|
+
python -m venv .venv && source .venv/bin/activate
|
|
100
|
+
pip install -e ".[dev]"
|
|
101
|
+
|
|
102
|
+
pytest -v
|
|
103
|
+
ruff check .
|
|
104
|
+
mypy src/
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Лицензия
|
|
108
|
+
|
|
109
|
+
GPL-3.0 — см. [LICENSE](LICENSE).
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# seaf-helper-tools
|
|
2
|
+
|
|
3
|
+
CLI-инструменты для работы с данными SEAF: конвертация анкет объектов оценки между форматами YAML и XLS, поддержка удалённых источников НСИ через JSONata API.
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install seaf-helper-tools
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Команды
|
|
12
|
+
|
|
13
|
+
| Команда | Описание |
|
|
14
|
+
|---------|----------|
|
|
15
|
+
| `survey-standards-yaml2xls` | Конвертировать YAML-анкету объекта оценки в XLS |
|
|
16
|
+
| `survey-standards-xls2yaml` | Конвертировать XLS-анкету обратно в YAML |
|
|
17
|
+
|
|
18
|
+
### Примеры
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Сгенерировать XLS из YAML
|
|
22
|
+
seaf-helper-tools survey-standards-yaml2xls input.yaml output.xlsx --template template.xlsx
|
|
23
|
+
|
|
24
|
+
# Конвертировать XLS обратно в YAML
|
|
25
|
+
seaf-helper-tools survey-standards-xls2yaml input.xlsx output.yaml
|
|
26
|
+
|
|
27
|
+
# С конфигурационным файлом (для подключения к API)
|
|
28
|
+
seaf-helper-tools --config config.yaml survey-standards-yaml2xls input.yaml output.xlsx
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Конфигурация
|
|
32
|
+
|
|
33
|
+
Для подключения к удалённому API NSI создайте `config.yaml` по образцу `config.example.yaml`:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
api:
|
|
37
|
+
url: https://your-seaf-instance/api
|
|
38
|
+
cert: /path/to/client.crt
|
|
39
|
+
key: /path/to/client.key
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Разработка
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
git clone https://gitverse.ru/alex314/helper_commands
|
|
46
|
+
cd seaf-helper-tools
|
|
47
|
+
python -m venv .venv && source .venv/bin/activate
|
|
48
|
+
pip install -e ".[dev]"
|
|
49
|
+
|
|
50
|
+
pytest -v
|
|
51
|
+
ruff check .
|
|
52
|
+
mypy src/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Лицензия
|
|
56
|
+
|
|
57
|
+
GPL-3.0 — см. [LICENSE](LICENSE).
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "seaf-helper-tools"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "CLI tools for working with SEAF assessment data: YAML/XLS conversion, standards surveys, remote NSI sources."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Alexandr Latushkin"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["seaf", "assessment", "yaml", "xls", "cli"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: System Administrators",
|
|
20
|
+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Operating System :: OS Independent",
|
|
25
|
+
"Environment :: Console",
|
|
26
|
+
"Topic :: Utilities",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"typer>=0.9.0",
|
|
30
|
+
"rich>=13.0",
|
|
31
|
+
"openpyxl>=3.1",
|
|
32
|
+
"ruamel.yaml>=0.18",
|
|
33
|
+
"requests>=2.31",
|
|
34
|
+
"urllib3>=2.0",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
Repository = "https://gitverse.ru/alex314/helper_commands"
|
|
39
|
+
|
|
40
|
+
[project.optional-dependencies]
|
|
41
|
+
dev = [
|
|
42
|
+
"pytest>=7.0",
|
|
43
|
+
"pytest-cov>=4.0",
|
|
44
|
+
"pytest-asyncio>=0.23",
|
|
45
|
+
"ruff>=0.1.0",
|
|
46
|
+
"mypy>=1.0",
|
|
47
|
+
"build>=1.0",
|
|
48
|
+
"twine>=5.0",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[project.scripts]
|
|
52
|
+
seaf-helper-tools = "helper_commands.cli:app"
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.packages.find]
|
|
55
|
+
where = ["src"]
|
|
56
|
+
|
|
57
|
+
[tool.ruff]
|
|
58
|
+
line-length = 88
|
|
59
|
+
target-version = "py311"
|
|
60
|
+
|
|
61
|
+
[tool.ruff.lint]
|
|
62
|
+
select = ["E", "F", "W", "I", "B", "UP"]
|
|
63
|
+
ignore = [
|
|
64
|
+
"B008", # typer.Argument/Option in defaults is standard Typer pattern
|
|
65
|
+
"E501", # line length — long Russian strings are unavoidable
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
[tool.mypy]
|
|
69
|
+
python_version = "3.11"
|
|
70
|
+
strict = true
|
|
71
|
+
warn_return_any = true
|
|
72
|
+
warn_unused_ignores = true
|
|
73
|
+
|
|
74
|
+
[tool.pytest.ini_options]
|
|
75
|
+
testpaths = ["tests"]
|
|
76
|
+
addopts = "-v --cov=src/helper_commands"
|
|
77
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""CLI entry point."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
|
|
8
|
+
from helper_commands.commands.assessment_xls2yaml import app as xls2yaml_app
|
|
9
|
+
from helper_commands.commands.assessment_yaml2xls import app as yaml2xls_app
|
|
10
|
+
|
|
11
|
+
app = typer.Typer(help="helper-commands — инструменты для работы с данными оценок")
|
|
12
|
+
console = Console()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@app.callback()
|
|
16
|
+
def main(
|
|
17
|
+
config: Path | None = typer.Option(
|
|
18
|
+
None,
|
|
19
|
+
"--config",
|
|
20
|
+
"-c",
|
|
21
|
+
help="Путь к YAML-файлу конфигурации",
|
|
22
|
+
exists=True,
|
|
23
|
+
dir_okay=False,
|
|
24
|
+
resolve_path=True,
|
|
25
|
+
),
|
|
26
|
+
) -> None:
|
|
27
|
+
"""helper-commands — инструменты для работы с данными оценок."""
|
|
28
|
+
if config is not None:
|
|
29
|
+
from helper_commands.core.config import load_config
|
|
30
|
+
|
|
31
|
+
load_config(config)
|
|
32
|
+
console.print(f"[dim]Конфигурация загружена: {config}[/dim]")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
app.add_typer(yaml2xls_app)
|
|
36
|
+
app.add_typer(xls2yaml_app)
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
app()
|
|
File without changes
|