mdify-cli 2.0.0__py3-none-any.whl → 2.2.0__py3-none-any.whl
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.
- mdify/__init__.py +1 -1
- mdify/cli.py +20 -4
- mdify/container.py +5 -1
- {mdify_cli-2.0.0.dist-info → mdify_cli-2.2.0.dist-info}/METADATA +1 -1
- mdify_cli-2.2.0.dist-info/RECORD +12 -0
- mdify_cli-2.0.0.dist-info/RECORD +0 -12
- {mdify_cli-2.0.0.dist-info → mdify_cli-2.2.0.dist-info}/WHEEL +0 -0
- {mdify_cli-2.0.0.dist-info → mdify_cli-2.2.0.dist-info}/entry_points.txt +0 -0
- {mdify_cli-2.0.0.dist-info → mdify_cli-2.2.0.dist-info}/licenses/LICENSE +0 -0
- {mdify_cli-2.0.0.dist-info → mdify_cli-2.2.0.dist-info}/top_level.txt +0 -0
mdify/__init__.py
CHANGED
mdify/cli.py
CHANGED
|
@@ -499,6 +499,13 @@ Examples:
|
|
|
499
499
|
help="Image pull policy: always, missing, never (default: missing)",
|
|
500
500
|
)
|
|
501
501
|
|
|
502
|
+
parser.add_argument(
|
|
503
|
+
"--timeout",
|
|
504
|
+
type=int,
|
|
505
|
+
default=None,
|
|
506
|
+
help="Conversion timeout in seconds (default: 1200, can be set via MDIFY_TIMEOUT env var)",
|
|
507
|
+
)
|
|
508
|
+
|
|
502
509
|
# Utility options
|
|
503
510
|
parser.add_argument(
|
|
504
511
|
"--check-update",
|
|
@@ -532,6 +539,9 @@ def main() -> int:
|
|
|
532
539
|
# Check for updates (daily, silent on errors)
|
|
533
540
|
check_for_update(force=False)
|
|
534
541
|
|
|
542
|
+
# Resolve timeout value: CLI > env > default 1200
|
|
543
|
+
timeout = args.timeout or int(os.environ.get("MDIFY_TIMEOUT", 1200))
|
|
544
|
+
|
|
535
545
|
# Validate input is provided
|
|
536
546
|
if args.input is None:
|
|
537
547
|
print("Error: Input file or directory is required", file=sys.stderr)
|
|
@@ -571,9 +581,15 @@ def main() -> int:
|
|
|
571
581
|
print(f"Run with --pull=missing or pull manually: {preferred} pull {image}")
|
|
572
582
|
return 1
|
|
573
583
|
|
|
574
|
-
# Resolve paths
|
|
575
|
-
|
|
576
|
-
|
|
584
|
+
# Resolve paths (use absolute() as fallback if resolve() fails due to permissions)
|
|
585
|
+
try:
|
|
586
|
+
input_path = Path(args.input).resolve()
|
|
587
|
+
except PermissionError:
|
|
588
|
+
input_path = Path(args.input).absolute()
|
|
589
|
+
try:
|
|
590
|
+
output_dir = Path(args.out_dir).resolve()
|
|
591
|
+
except PermissionError:
|
|
592
|
+
output_dir = Path(args.out_dir).absolute()
|
|
577
593
|
|
|
578
594
|
# Validate input
|
|
579
595
|
if not input_path.exists():
|
|
@@ -622,7 +638,7 @@ def main() -> int:
|
|
|
622
638
|
print(f"Starting docling-serve container...")
|
|
623
639
|
print()
|
|
624
640
|
|
|
625
|
-
with DoclingContainer(runtime, image, args.port) as container:
|
|
641
|
+
with DoclingContainer(runtime, image, args.port, timeout=timeout) as container:
|
|
626
642
|
# Convert files
|
|
627
643
|
conversion_start = time.time()
|
|
628
644
|
spinner = Spinner()
|
mdify/container.py
CHANGED
|
@@ -20,17 +20,19 @@ class DoclingContainer:
|
|
|
20
20
|
# Container automatically stopped and removed
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
def __init__(self, runtime: str, image: str, port: int = 5001):
|
|
23
|
+
def __init__(self, runtime: str, image: str, port: int = 5001, timeout: int = 1200):
|
|
24
24
|
"""Initialize container manager.
|
|
25
25
|
|
|
26
26
|
Args:
|
|
27
27
|
runtime: Container runtime ("docker" or "podman")
|
|
28
28
|
image: Container image to use
|
|
29
29
|
port: Host port to bind (default: 5001)
|
|
30
|
+
timeout: Conversion timeout in seconds (default: 1200)
|
|
30
31
|
"""
|
|
31
32
|
self.runtime = runtime
|
|
32
33
|
self.image = image
|
|
33
34
|
self.port = port
|
|
35
|
+
self.timeout = timeout
|
|
34
36
|
self.container_name = f"mdify-serve-{uuid.uuid4().hex[:8]}"
|
|
35
37
|
self.container_id: Optional[str] = None
|
|
36
38
|
|
|
@@ -59,6 +61,8 @@ class DoclingContainer:
|
|
|
59
61
|
self.container_name,
|
|
60
62
|
"-p",
|
|
61
63
|
f"{self.port}:5001",
|
|
64
|
+
"-e",
|
|
65
|
+
f"DOCLING_SERVE_MAX_SYNC_WAIT={self.timeout}",
|
|
62
66
|
self.image,
|
|
63
67
|
]
|
|
64
68
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
|
|
2
|
+
mdify/__init__.py,sha256=4NX0fOc0lT__u0TDFhYE_eqxCi5okSkGnbGa1BB-M70,90
|
|
3
|
+
mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
|
|
4
|
+
mdify/cli.py,sha256=5cplmrH8pk8VvW-bA6deAvGpkhH57KPLoajp4C0U7q8,22080
|
|
5
|
+
mdify/container.py,sha256=2oh9NyvFr9lCRb2YYpM_qKP3PPmAin0DbxvNP3m69jw,4158
|
|
6
|
+
mdify/docling_client.py,sha256=_9qjL5yOOeJahOg6an2P6Iii1xkeR6wmNJZG4Q6NRkk,6553
|
|
7
|
+
mdify_cli-2.2.0.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
|
|
8
|
+
mdify_cli-2.2.0.dist-info/METADATA,sha256=LBH8ZNtc9F4mO699EPkEpWZZZm0HV_EH06tw5aPuAY8,7923
|
|
9
|
+
mdify_cli-2.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
mdify_cli-2.2.0.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
|
|
11
|
+
mdify_cli-2.2.0.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
|
|
12
|
+
mdify_cli-2.2.0.dist-info/RECORD,,
|
mdify_cli-2.0.0.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
|
|
2
|
-
mdify/__init__.py,sha256=s7XlWmH4zJ5jFiPjpd7mXrCaU8bD-S9RaPzT2VHUdeQ,90
|
|
3
|
-
mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
|
|
4
|
-
mdify/cli.py,sha256=LY0q8NlnKuN5aFz_OpO5hGro-tQNCxoYO_M0qVd6FJY,21493
|
|
5
|
-
mdify/container.py,sha256=AVIhiq_wO5id5hQ_s83lUPkAPCsAoTs25azRT6JmKII,3962
|
|
6
|
-
mdify/docling_client.py,sha256=_9qjL5yOOeJahOg6an2P6Iii1xkeR6wmNJZG4Q6NRkk,6553
|
|
7
|
-
mdify_cli-2.0.0.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
|
|
8
|
-
mdify_cli-2.0.0.dist-info/METADATA,sha256=92_uBI2nnKK-YEf39TB7gX1KHbZBHqIHxLZBe7-GOqY,7923
|
|
9
|
-
mdify_cli-2.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
-
mdify_cli-2.0.0.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
|
|
11
|
-
mdify_cli-2.0.0.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
|
|
12
|
-
mdify_cli-2.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|