extract-python 0.5.13__tar.gz → 0.5.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: extract-python
3
- Version: 0.5.13
3
+ Version: 0.5.15
4
4
  Summary: Structured content extraction
5
5
  Project-URL: Homepage, https://github.com/ICIJ/extract-python
6
6
  Project-URL: Repository, https://github.com/ICIJ/extract-python
@@ -1,7 +1,10 @@
1
1
  import asyncio
2
+ import json
3
+ import logging
2
4
  import shutil
3
5
  import tempfile
4
6
  from collections.abc import AsyncGenerator, Iterable, Iterator
7
+ from functools import partial
5
8
  from pathlib import Path
6
9
  from typing import Any, Self
7
10
 
@@ -36,6 +39,8 @@ from pydantic_core.core_schema import SerializerFunctionWrapHandler
36
39
  from .constants import ARTIFACTS, DEFAULT_MD_PAGE_SEP
37
40
  from .utils import chdir, map_and_preserve, path_to_artifacts_dirname
38
41
 
42
+ logger = logging.getLogger(__name__)
43
+
39
44
  DOCLING_DEFAULT_ARTIFACTS_PATH = Path.home().joinpath(".cache", "docling", "models")
40
45
 
41
46
 
@@ -48,9 +53,13 @@ class DoclingPipeline(Pipeline):
48
53
  device: Device = Device.CPU,
49
54
  ):
50
55
  super().__init__(device)
51
- format_options = {
52
- k: v.to_docling(self._device) for k, v in format_options.items()
53
- }
56
+ format_options = dict()
57
+ for k, v in format_options.items():
58
+ format_options[k] = v.to_docling(self._device)
59
+ logger.info(
60
+ "resolved format options to: %s",
61
+ lambda: partial(json.dumps, format_options, indent=2),
62
+ )
54
63
  allowed_format = [
55
64
  f.to_docling() for f in DoclingPipelineConfig.supported_exts()
56
65
  ]
File without changes