mdify-cli 3.0.1__tar.gz → 3.0.2__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.
Files changed (27) hide show
  1. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/PKG-INFO +1 -1
  2. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/__init__.py +1 -1
  3. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/cli.py +14 -5
  4. mdify_cli-3.0.2/mdify/formatting.py +29 -0
  5. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify_cli.egg-info/PKG-INFO +1 -1
  6. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify_cli.egg-info/SOURCES.txt +1 -0
  7. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/pyproject.toml +1 -1
  8. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/LICENSE +0 -0
  9. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/README.md +0 -0
  10. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/assets/mdify.png +0 -0
  11. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/__main__.py +0 -0
  12. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/container.py +0 -0
  13. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/docling_client.py +0 -0
  14. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/ssh/__init__.py +0 -0
  15. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/ssh/client.py +0 -0
  16. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/ssh/models.py +0 -0
  17. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/ssh/remote_container.py +0 -0
  18. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify/ssh/transfer.py +0 -0
  19. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify_cli.egg-info/dependency_links.txt +0 -0
  20. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify_cli.egg-info/entry_points.txt +0 -0
  21. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify_cli.egg-info/requires.txt +0 -0
  22. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/mdify_cli.egg-info/top_level.txt +0 -0
  23. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/setup.cfg +0 -0
  24. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/tests/test_cli.py +0 -0
  25. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/tests/test_container.py +0 -0
  26. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/tests/test_docling_client.py +0 -0
  27. {mdify_cli-3.0.1 → mdify_cli-3.0.2}/tests/test_ssh_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mdify-cli
3
- Version: 3.0.1
3
+ Version: 3.0.2
4
4
  Summary: Convert PDFs and document images into structured Markdown for LLM workflows
5
5
  Author: tiroq
6
6
  License-Expression: MIT
@@ -1,3 +1,3 @@
1
1
  """mdify - Convert documents to Markdown via Docling container."""
2
2
 
3
- __version__ = "3.0.1"
3
+ __version__ = "3.0.2"
@@ -1050,6 +1050,9 @@ def main_async_remote(args) -> int:
1050
1050
 
1051
1051
  async def async_main() -> int:
1052
1052
  """Async implementation of remote conversion."""
1053
+ from mdify.formatting import Colorizer
1054
+
1055
+ color = Colorizer(sys.stderr)
1053
1056
 
1054
1057
  # Resolve timeout value: CLI > env > default 1200
1055
1058
  timeout = args.timeout or int(os.environ.get("MDIFY_TIMEOUT", 1200))
@@ -1238,14 +1241,17 @@ def main_async_remote(args) -> int:
1238
1241
  try:
1239
1242
  for idx, input_file in enumerate(files_to_convert, 1):
1240
1243
  if not args.quiet:
1241
- print(f"\n[{idx}/{len(files_to_convert)}] Processing: {input_file.name}", file=sys.stderr)
1244
+ print(
1245
+ f"\n{color.cyan(f'[{idx}/{len(files_to_convert)}] Processing:')} {input_file.name}",
1246
+ file=sys.stderr,
1247
+ )
1242
1248
 
1243
1249
  try:
1244
1250
  # Upload file
1245
1251
  remote_file_path = f"{work_dir}/{input_file.name}"
1246
1252
 
1247
1253
  if not args.quiet:
1248
- print(f" Uploading to {remote_file_path}...", file=sys.stderr)
1254
+ print(f" {color.cyan('Uploading to')} {remote_file_path}...", file=sys.stderr)
1249
1255
 
1250
1256
  await transfer_manager.upload_file(
1251
1257
  local_path=str(input_file),
@@ -1254,11 +1260,11 @@ def main_async_remote(args) -> int:
1254
1260
  )
1255
1261
 
1256
1262
  if not args.quiet:
1257
- print(f" ✓ Upload complete", file=sys.stderr)
1263
+ print(f" {color.green('✓ Upload complete')}", file=sys.stderr)
1258
1264
 
1259
1265
  # Convert via remote container
1260
1266
  if not args.quiet:
1261
- print(f" Converting via remote container...", file=sys.stderr)
1267
+ print(f" {color.cyan('Converting via remote container')}...", file=sys.stderr)
1262
1268
 
1263
1269
  # Determine output path
1264
1270
  output_dir = Path(args.out_dir)
@@ -1279,7 +1285,10 @@ def main_async_remote(args) -> int:
1279
1285
  # Check if output exists and skip if not overwrite
1280
1286
  if output_file.exists() and not args.overwrite:
1281
1287
  if not args.quiet:
1282
- print(f" ⊘ Skipped: {output_file} already exists (use --overwrite to replace)", file=sys.stderr)
1288
+ print(
1289
+ f" {color.yellow('⊘ Skipped:')} {output_file} already exists (use --overwrite to replace)",
1290
+ file=sys.stderr,
1291
+ )
1283
1292
  continue
1284
1293
 
1285
1294
  # Convert using remote container's HTTP API
@@ -0,0 +1,29 @@
1
+ """Formatting helpers for CLI output."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from typing import TextIO
7
+
8
+
9
+ class Colorizer:
10
+ """ANSI color helper for terminal output."""
11
+
12
+ def __init__(self, stream: TextIO) -> None:
13
+ force_color = os.environ.get("FORCE_COLOR")
14
+ no_color = os.environ.get("NO_COLOR")
15
+ self.enabled = bool(force_color) or (stream.isatty() and not no_color)
16
+
17
+ def color(self, text: str, code: str) -> str:
18
+ if not self.enabled:
19
+ return text
20
+ return f"\033[{code}m{text}\033[0m"
21
+
22
+ def green(self, text: str) -> str:
23
+ return self.color(text, "32")
24
+
25
+ def yellow(self, text: str) -> str:
26
+ return self.color(text, "33")
27
+
28
+ def cyan(self, text: str) -> str:
29
+ return self.color(text, "36")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mdify-cli
3
- Version: 3.0.1
3
+ Version: 3.0.2
4
4
  Summary: Convert PDFs and document images into structured Markdown for LLM workflows
5
5
  Author: tiroq
6
6
  License-Expression: MIT
@@ -6,6 +6,7 @@ mdify/__main__.py
6
6
  mdify/cli.py
7
7
  mdify/container.py
8
8
  mdify/docling_client.py
9
+ mdify/formatting.py
9
10
  mdify/../assets/mdify.png
10
11
  mdify/ssh/__init__.py
11
12
  mdify/ssh/client.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mdify-cli"
3
- version = "3.0.1"
3
+ version = "3.0.2"
4
4
  description = "Convert PDFs and document images into structured Markdown for LLM workflows"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes