Raykov-MS 6229fe7814 Match the reference export on the card number and document prefix
Compared our report against the customer's own new-format export for
10.08.2026 (121 columns) over the 124 source files that produced it. Records
and participant rows line up exactly: 11393 records and 22839 rows on both
sides, no record with a different participant count. 90 of the 104 comparable
columns already matched value for value.

Two differences were ours to fix:

- Column 102, the card number in the foreign bank card block, took its value
  from СведенияВнесениеПолучениеНалДС/НомерКарта whenever the foreign card
  block was missing, because short lookup matches the tag НомерКарта in both
  blocks. The reference leaves the column empty there and shows the number in
  column 81 only, which is what we now do. 63 records on this export.
- The operation-document aggregate numbered its entries "1. ", the reference
  uses "1, ". That was 11377 rows out of 11393.

The remaining differences are the reference's own presentation of aggregate
cells and need the customer's word before touching them: it joins ФИО with
", " and keeps a trailing comma for a missing patronymic, spells the document
that proves identity as labelled lines ("Вид документа: 21\nСерия…") where we
use a comma list, and inserts the name of the region decoded from the ОКАТО
code into address cells, which the schema does not carry at all.

Two columns the reference fills and our form has no place for: the reporting
bank's own registration number, БИК and ОКАТО, and the authorised officer's
name, position, phone and e-mail. Both come from ИнфБанк and СлужЧасть.
2026-09-29 19:41:50 +03:00
2026-09-17 13:04:35 +03:00
fix
2026-08-11 01:09:07 +03:00
2026-06-04 14:13:30 +03:00
2026-06-04 14:13:30 +03:00
fix
2026-08-11 01:09:07 +03:00
2026-09-17 13:04:35 +03:00
2026-06-04 14:13:30 +03:00
2026-06-22 07:25:27 +03:00
2026-09-17 13:04:35 +03:00

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/

Основной поток

  1. Пользователь вводит SAMBA логин/пароль.
  2. При необходимости меняет персональный input_dir (с pre-check доступа).
  3. Нажимает Запустить обработку xml в excel.
  4. Пайплайн:
    • сканирует входную папку;
    • невалидные имена переносит в Err;
    • валидные XML парсит и формирует строки отчета;
    • создает report.xlsx, protocol.xlsx, process.log;
    • сохраняет артефакты в Out/YYYY/MM_YYYY/YYYYMMDD/run_number/;
    • успешные файлы переносит в Processed.
  5. В 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

Хуки:

  • black
  • isort
  • ruff
  • ruff-format
Description
No description provided
Readme 12 MiB
Languages
Python 100%