chore(deps): remove unused proprietary dep pymupdf-layout
pymupdf-layout is Artifex commercial-only proprietary (its wheel ships only a one-line COPYING noting "Commercial license. See artifex.com"), incompatible with the project's AGPL build. It was declared as a runtime dependency but unused: not imported anywhere in nextcloud_mcp_server/ or tests/. Also drop tools/parse-doc.py, an unused dev scratch script that was the only caller of pymupdf.layout.activate(). Per the explicit warning in document_processors/pymupdf.py, activating layout breaks pymupdf4llm.to_markdown(page_chunks=True) per pymupdf4llm#323. Closes #725 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
a9c5759869
commit
ad132dd6f1
@@ -1,41 +0,0 @@
|
||||
import logging
|
||||
import pathlib
|
||||
|
||||
import anyio
|
||||
import pymupdf
|
||||
import pymupdf.layout
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
pymupdf.layout.activate()
|
||||
import pymupdf4llm # noqa: E402
|
||||
|
||||
client = NextcloudClient.from_env()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
TMP_DIR = pathlib.Path("/tmp/tmp-images")
|
||||
TMP_DIR.mkdir(exist_ok=True, parents=True)
|
||||
|
||||
|
||||
async def print_markdown(filename):
|
||||
content, _ = await client.webdav.read_file(filename)
|
||||
doc = pymupdf.open("pdf", content)
|
||||
md_text = pymupdf4llm.to_markdown(doc, write_images=True, image_path=str(TMP_DIR))
|
||||
print(md_text)
|
||||
|
||||
|
||||
async def run1():
|
||||
response = await client.webdav.find_by_type("application/pdf")
|
||||
# print(response)
|
||||
for file in response:
|
||||
await print_markdown(file["path"])
|
||||
|
||||
|
||||
async def run():
|
||||
tags = await client.tags.get_all_tags()
|
||||
print(tags)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level="INFO")
|
||||
anyio.run(run)
|
||||
Reference in New Issue
Block a user