mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-24 21:41:04 +02:00
chore: name the extra after its dependency; keep README install section minimal
This commit is contained in:
parent
472d871ac3
commit
74c8f7b271
4 changed files with 3 additions and 5 deletions
|
|
@ -153,8 +153,6 @@ A unified `PageIndexClient` powers both local self-hosted and cloud-managed mode
|
||||||
pip install pageindex
|
pip install pageindex
|
||||||
```
|
```
|
||||||
|
|
||||||
Local-mode image extraction uses PyMuPDF (AGPL-licensed) and is an optional extra: `pip install "pageindex[images]"`. Without it, local indexing is text-only.
|
|
||||||
|
|
||||||
### Quick start
|
### Quick start
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
|
|
||||||
|
|
@ -816,7 +816,7 @@ def get_page_tokens(pdf_path, model=None, pdf_parser="PyPDF2"):
|
||||||
page_list.append((page_text, token_length))
|
page_list.append((page_text, token_length))
|
||||||
return page_list
|
return page_list
|
||||||
elif pdf_parser == "PyMuPDF":
|
elif pdf_parser == "PyMuPDF":
|
||||||
import pymupdf # optional dependency: pip install pageindex[images]
|
import pymupdf # optional dependency: pip install pageindex[pymupdf]
|
||||||
if isinstance(pdf_path, BytesIO):
|
if isinstance(pdf_path, BytesIO):
|
||||||
pdf_stream = pdf_path
|
pdf_stream = pdf_path
|
||||||
doc = pymupdf.open(stream=pdf_stream, filetype="pdf")
|
doc = pymupdf.open(stream=pdf_stream, filetype="pdf")
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class PdfParser:
|
||||||
if not _warned_no_pymupdf:
|
if not _warned_no_pymupdf:
|
||||||
logging.getLogger(__name__).warning(
|
logging.getLogger(__name__).warning(
|
||||||
"PyMuPDF is not installed; skipping image extraction. "
|
"PyMuPDF is not installed; skipping image extraction. "
|
||||||
'Install with: pip install "pageindex[images]"')
|
'Install with: pip install "pageindex[pymupdf]"')
|
||||||
_warned_no_pymupdf = True
|
_warned_no_pymupdf = True
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ typing-extensions = ">=4.9.0"
|
||||||
pydantic = ">=2.5.0,<3.0.0"
|
pydantic = ">=2.5.0,<3.0.0"
|
||||||
|
|
||||||
[tool.poetry.extras]
|
[tool.poetry.extras]
|
||||||
images = ["pymupdf"]
|
pymupdf = ["pymupdf"]
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = ">=7.0"
|
pytest = ">=7.0"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue