Raykov-MS 5825ca2aed Apply report formatting fixes requested on 24.09.2026
- Draw a grid on the two header rows only, data cells stay borderless.
- Align column names to the top so the start of a long name stays visible.
- Narrow the 14 code columns to the length of their values; the rule matches
  by column name, so identical indicators in every block get equal widths.
- Halve both payment system name columns (32 -> 16).
- Give "Характеристика операции" the same width as "Назначение платежа".
- Drop the group title above "Статус перевода": it duplicated the column name.
  The group cell stays in place so the header grid is not broken.
- Pass the cell format to write_string. Identifier columns (БИК, ИНН, ОГРН,
  КПП, СВИФТ, account numbers) were written without one, so text wrapping and
  vertical alignment never applied to them - this is why БИК had no line break.

The width padding and the header rotation are single constants: the customer
has not confirmed yet whether "N знаков" means the value length (implemented)
or an amount to subtract, and whether narrow headers should be rotated.
2026-09-24 14:25:57 +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%