mdify-cli 1.3.1__py3-none-any.whl → 1.4.1__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.
assets/mdify.png ADDED
Binary file
mdify/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """mdify - Convert documents to Markdown via Docling container."""
2
2
 
3
- __version__ = "1.3.1"
3
+ __version__ = "1.4.1"
mdify/cli.py CHANGED
@@ -25,8 +25,7 @@ from . import __version__
25
25
  # Configuration
26
26
  MDIFY_HOME = Path.home() / ".mdify"
27
27
  LAST_CHECK_FILE = MDIFY_HOME / ".last_check"
28
- INSTALLER_PATH = MDIFY_HOME / "install.sh"
29
- GITHUB_API_URL = "https://api.github.com/repos/tiroq/mdify/releases/latest"
28
+ PYPI_API_URL = "https://pypi.org/pypi/mdify-cli/json"
30
29
  CHECK_INTERVAL_SECONDS = 86400 # 24 hours
31
30
 
32
31
  # Container configuration
@@ -40,16 +39,16 @@ SUPPORTED_RUNTIMES = ("docker", "podman")
40
39
 
41
40
  def _get_remote_version(timeout: int = 5) -> Optional[str]:
42
41
  """
43
- Fetch the latest version from GitHub API.
42
+ Fetch the latest version from PyPI.
44
43
 
45
44
  Returns:
46
- Version string (e.g., "0.2.0") or None if fetch failed.
45
+ Version string (e.g., "1.1.0") or None if fetch failed.
47
46
  """
48
47
  try:
49
- with urlopen(GITHUB_API_URL, timeout=timeout) as response:
48
+ with urlopen(PYPI_API_URL, timeout=timeout) as response:
50
49
  data = json.loads(response.read().decode("utf-8"))
51
- tag = data.get("tag_name", "")
52
- return tag.lstrip("v") if tag else None
50
+ version = data.get("info", {}).get("version", "")
51
+ return version if version else None
53
52
  except (URLError, json.JSONDecodeError, KeyError, TimeoutError):
54
53
  return None
55
54
 
@@ -104,34 +103,6 @@ def _compare_versions(current: str, remote: str) -> bool:
104
103
  return False
105
104
 
106
105
 
107
- def _run_upgrade() -> bool:
108
- """
109
- Run the upgrade installer.
110
-
111
- Returns:
112
- True if upgrade was successful, False otherwise.
113
- """
114
- if not INSTALLER_PATH.exists():
115
- print(
116
- f"Installer not found at {INSTALLER_PATH}. "
117
- "Please reinstall mdify manually.",
118
- file=sys.stderr,
119
- )
120
- return False
121
-
122
- try:
123
- result = subprocess.run(
124
- [str(INSTALLER_PATH), "--upgrade", "-y"],
125
- check=True,
126
- )
127
- return result.returncode == 0
128
- except subprocess.CalledProcessError:
129
- return False
130
- except OSError as e:
131
- print(f"Failed to run installer: {e}", file=sys.stderr)
132
- return False
133
-
134
-
135
106
  def check_for_update(force: bool = False) -> None:
136
107
  """
137
108
  Check for updates and prompt user to upgrade if available.
@@ -162,27 +133,13 @@ def check_for_update(force: bool = False) -> None:
162
133
  return
163
134
 
164
135
  print(f"\n{'='*50}")
165
- print(f"A new version of mdify is available!")
136
+ print(f"A new version of mdify-cli is available!")
166
137
  print(f" Current version: {__version__}")
167
138
  print(f" Latest version: {remote_version}")
168
- print(f"{'='*50}\n")
169
-
170
- try:
171
- response = input("Run upgrade now? [y/N] ").strip().lower()
172
- except (EOFError, KeyboardInterrupt):
173
- print()
174
- return
175
-
176
- if response in ("y", "yes"):
177
- print("\nStarting upgrade...\n")
178
- if _run_upgrade():
179
- print("\nUpgrade completed! Please restart mdify.")
180
- sys.exit(0)
181
- else:
182
- print("\nUpgrade failed. You can try manually with:")
183
- print(f" {INSTALLER_PATH} --upgrade")
184
- else:
185
- print(f"\nTo upgrade later, run: {INSTALLER_PATH} --upgrade\n")
139
+ print(f"{'='*50}")
140
+ print(f"\nTo upgrade, run:")
141
+ print(f" pipx upgrade mdify-cli")
142
+ print(f" # or: pip install --upgrade mdify-cli\n")
186
143
 
187
144
 
188
145
  # =============================================================================
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mdify-cli
3
- Version: 1.3.1
3
+ Version: 1.4.1
4
4
  Summary: Lightweight CLI for converting documents to Markdown via Docling container
5
5
  Author: tiroq
6
6
  License-Expression: MIT
@@ -28,7 +28,7 @@ Dynamic: license-file
28
28
 
29
29
  # mdify
30
30
 
31
- ![MDify banner](assets/mdify.png)
31
+ ![mdify banner](https://raw.githubusercontent.com/tiroq/mdify/main/assets/mdify.png)
32
32
 
33
33
  [![PyPI](https://img.shields.io/pypi/v/mdify-cli?logo=python&style=flat-square)](https://pypi.org/project/mdify-cli/)
34
34
  [![Container](https://img.shields.io/badge/container-ghcr.io-blue?logo=docker&style=flat-square)](https://github.com/tiroq/mdify/pkgs/container/mdify-runtime)
@@ -0,0 +1,10 @@
1
+ assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
2
+ mdify/__init__.py,sha256=NWY-5XYsO7gQZs9c4utyzGda6anA_FDBB2LNNUIqsdo,90
3
+ mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
4
+ mdify/cli.py,sha256=D8_1_6NgWXkexGWqkgB0JO7c1r2T2_Va7J7iGwvewQA,20038
5
+ mdify_cli-1.4.1.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
6
+ mdify_cli-1.4.1.dist-info/METADATA,sha256=sZgTSq6CrpBgpJn0NCnLcBYNTp2e0byKeFkAOO6em3E,6667
7
+ mdify_cli-1.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ mdify_cli-1.4.1.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
9
+ mdify_cli-1.4.1.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
10
+ mdify_cli-1.4.1.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- mdify/__init__.py,sha256=i8PTIA0EY8RsB6lf3pwGlb0oX30633B0o2KMcqaGl4c,90
2
- mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
3
- mdify/cli.py,sha256=t1c3lSDwB5zco-gji-udZkx_5OPCmLNFRN05XULW7TM,21242
4
- mdify_cli-1.3.1.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
5
- mdify_cli-1.3.1.dist-info/METADATA,sha256=pKbl1j497DivGmonSaXZ9tE8wE9x0lS5QXdpQ3ozLaM,6616
6
- mdify_cli-1.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- mdify_cli-1.3.1.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
8
- mdify_cli-1.3.1.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
9
- mdify_cli-1.3.1.dist-info/RECORD,,