From 89c84ff7490b0341368113096f16f3b0a90c84b7 Mon Sep 17 00:00:00 2001 From: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:31:11 +0100 Subject: [PATCH] refactor: group XML backend parsers in a subfolder Signed-off-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com> --- docling/backend/{xml_uspto_backend.py => xml/uspto_backend.py} | 0 docling/datamodel/base_models.py | 2 +- docling/document_converter.py | 2 +- tests/test_backend_patent_uspto.py | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename docling/backend/{xml_uspto_backend.py => xml/uspto_backend.py} (100%) diff --git a/docling/backend/xml_uspto_backend.py b/docling/backend/xml/uspto_backend.py similarity index 100% rename from docling/backend/xml_uspto_backend.py rename to docling/backend/xml/uspto_backend.py diff --git a/docling/datamodel/base_models.py b/docling/datamodel/base_models.py index 257533f1..1a073c63 100644 --- a/docling/datamodel/base_models.py +++ b/docling/datamodel/base_models.py @@ -43,7 +43,7 @@ class InputFormat(str, Enum): ASCIIDOC = "asciidoc", False MD = "md", False XLSX = "xlsx", False - XML_USPTO = "uspto", True + XML_USPTO = "xml_uspto", True @override def __new__(cls, value: str, _) -> Self: diff --git a/docling/document_converter.py b/docling/document_converter.py index 48e41d6c..44815630 100644 --- a/docling/document_converter.py +++ b/docling/document_converter.py @@ -15,7 +15,7 @@ from docling.backend.md_backend import MarkdownDocumentBackend from docling.backend.msexcel_backend import MsExcelDocumentBackend from docling.backend.mspowerpoint_backend import MsPowerpointDocumentBackend from docling.backend.msword_backend import MsWordDocumentBackend -from docling.backend.xml_uspto_backend import PatentUsptoDocumentBackend +from docling.backend.xml.uspto_backend import PatentUsptoDocumentBackend from docling.datamodel.base_models import ( ConversionStatus, DoclingComponentType, diff --git a/tests/test_backend_patent_uspto.py b/tests/test_backend_patent_uspto.py index 8e34d2b4..466568ac 100644 --- a/tests/test_backend_patent_uspto.py +++ b/tests/test_backend_patent_uspto.py @@ -12,7 +12,7 @@ import yaml from docling_core.types import DoclingDocument from docling_core.types.doc import DocItemLabel, TableData, TextItem -from docling.backend.xml_uspto_backend import PatentUsptoDocumentBackend, XmlTable +from docling.backend.xml.uspto_backend import PatentUsptoDocumentBackend, XmlTable from docling.datamodel.base_models import InputFormat from docling.datamodel.document import ( ConversionResult,