The customer's ruling of 24.09.2026 is that every value present in the XML must reach the report, taking into account which block holds it. Two defects broke that for operation code 5016 with transfer types 4 and 5. Wrong paths in mapping_table.json. Columns 48-63 spelled the block as "СведенияПереводыДс" and columns 49-59 spelled the address as "АдрМестоПриемаВыдача"; the schema uses "СведенияПереводыДС" and "АдрМестаПриемаВыдача". Those columns carry allow_short_lookup=false, so they can only match on a fully scoped path and never matched at all: the whole cash receipt block (AV-BI) and the transfer status (BJ) stayed empty on every file. The existing test passed only because it fed the same misspellings. Rules that deleted data instead of filling it: - Rules 38, 44-45 and 46 wiped the account columns for code 5016. The XML of those records carries СчетБанкПолучатель = 00000000000000000000, which is exactly the value the customer asked for. The rules now only substitute the placeholder into an empty column, and never for 5016. - Rule 44 also wiped the correspondent accounts for operator types 3 and 5 even when the XML had them. - The cashless rule wiped columns 50, 61, 65, 76, 84, 95, 99 and 101 for transfer types 1-4, 7 and 10-14, although type 4 is by definition a transfer that accepts cash and must carry the receipt block. - Rule 62 limited the transfer status to types 2, 5 and 8. - Rule 30 limited the metal name to code C99, while the available exports only ever carry code A90. Verified on the sample exports: all 16 records with code 5016 now carry the zeros in column 45, the real account in column 46, and no invented placeholders in columns 38 and 44.
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%