Verified our report against the Комита reference export by joining on the record id. Our report_20260923_5.xlsx covers the 114 files of 30.01.2023 and all 5266 of its records are inside the reference period, so the two can be compared row by row. Fifteen of the twenty-one shared columns already match exactly. The largest remaining gap was the separator in the code lists: the reference prints "1101,1106,1499" while the parser joins repeated tags with "; ", which put 336 of 5266 records out of step. Only the two code-list columns are brought to the reference's separator; "; " stays in the free-text columns, where it reads better and where the reference has no equivalent. What the comparison also showed, for the record: - The empty branch БИК and number on head-office records are correct. Those files carry no ИнфФилиал block at all and the reference leaves the cells empty too. - Of the 105 address differences, 94 are the column 141 leak fixed in cceee02, and the remaining 11 are values that contain a comma, such as Пункт = "Южно-Сахалинск г, Хомутово пл.р-н", which the reference cannot represent in one comma-joined cell. - Column 121 shows РегнНомер for people in private practice, where the reference's ОГРН column stays empty. That is the mapping table's fourth source for the column, not a defect: 3 records out of 13168.
SFM Streamlit
Production-ready Streamlit приложение для обработки ФЭС XML файлов в Excel-отчет и протокол с доступом к файлам через SAMBA (rail_connectors).
Архитектура
main.py
app/
app_config.py # константы приложения и user-id
path_store.py # JSON-хранилище персональных путей
path_settings.py # UI-модалка изменения пути
samba_access.py # проверка доступа к SAMBA папке
auth/
service.py # orchestration auth/session
providers.py
mock_provider.py
pipeline/
config.py # шаблоны имен/путей пайплайна
file_manager.py # scan/move/upload/download в SAMBA
parser.py # namespace-aware парсер ФЭС XML
report.py # генерация report.xlsx
protocol.py # генерация protocol.xlsx
service.py # run_batch orchestration
tests/
unit/
smoke/
Основной поток
- Пользователь вводит SAMBA логин/пароль.
- При необходимости меняет персональный
input_dir(с pre-check доступа). - Нажимает
Запустить обработку xml в excel. - Пайплайн:
- сканирует входную папку;
- невалидные имена переносит в
Err; - валидные XML парсит и формирует строки отчета;
- создает
report.xlsx,protocol.xlsx,process.log; - сохраняет артефакты в
Out/YYYY/MM_YYYY/YYYYMMDD/run_number/; - успешные файлы переносит в
Processed.
- В UI отображаются счетчики и пути к артефактам.
Переменные окружения
Используются переменные авторизации Raisa (OPENBAO__SETTINGS__*).
SMBA source и дефолтный путь входа задаются в коде (app/app_config.py).
Быстрый старт
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
streamlit run main.py
Тесты и качество
pytest
ruff check .
black --check .
isort --check-only .
Pre-commit
pre-commit install
pre-commit run --all-files
Хуки:
blackisortruffruff-format
Description
Languages
Python
100%