Приём документов → реестр + журнал

Внесение данных из файлов приёма в реестр невостребованных документов
и заполнение журнала. Дата внесения — текущая; журнал заполняется чисто
(без строк-примеров шаблона).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jze9
2026-06-26 03:11:18 +05:00
commit b5f7060a1f
20 changed files with 1571 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
"""Читатель .xlsx (openpyxl)."""
from __future__ import annotations
from typing import List
import openpyxl
from ..models import CellValue
from .base import SourceReader
class XlsxReader(SourceReader):
def _rows(self) -> List[List[CellValue]]:
wb = openpyxl.load_workbook(self.path, data_only=True, read_only=True)
try:
ws = wb.worksheets[0]
rows: List[List[CellValue]] = []
for row in ws.iter_rows(values_only=True):
rows.append([_norm(v) for v in row])
return rows
finally:
wb.close()
def _norm(value: CellValue) -> CellValue:
if isinstance(value, str):
value = value.strip()
return value or None
return value