MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / get_text

Function get_text

src/__init__.py:24778–24839  ·  view source on GitHub ↗

Returns list of results from `Page.get_text()`, optionally using concurrency for speed. Args: path: Path of document. pages: List of page numbers to process, or None to include all pages. method: 'single' D

(
        path,
        *,
        pages=None,
        method='single',
        concurrency=None,
        
        option='text',
        clip=None,
        flags=None,
        textpage=None,
        sort=False,
        delimiters=None,
        
        _stats=False,
        )

Source from the content-addressed store, hash-verified

24776
24777
24778def get_text(
24779 path,
24780 *,
24781 pages=None,
24782 method='single',
24783 concurrency=None,
24784
24785 option='text',
24786 clip=None,
24787 flags=None,
24788 textpage=None,
24789 sort=False,
24790 delimiters=None,
24791
24792 _stats=False,
24793 ):
24794 '''
24795 Returns list of results from `Page.get_text()`, optionally using
24796 concurrency for speed.
24797
24798 Args:
24799 path:
24800 Path of document.
24801 pages:
24802 List of page numbers to process, or None to include all pages.
24803 method:
24804 'single'
24805 Do not use concurrency.
24806 'mp'
24807 Operate concurrently using Python's `multiprocessing` module.
24808 'fork'
24809 Operate concurrently using custom implementation with
24810 `os.fork`. Does not work on Windows.
24811 concurrency:
24812 Number of worker processes to use when operating concurrently. If
24813 None, we use the number of available CPUs.
24814 option
24815 clip
24816 flags
24817 textpage
24818 sort
24819 delimiters:
24820 Passed to internal calls to `Page.get_text()`.
24821 '''
24822 args_dict = dict(
24823 option=option,
24824 clip=clip,
24825 flags=flags,
24826 textpage=textpage,
24827 sort=sort,
24828 delimiters=delimiters,
24829 )
24830
24831 return apply_pages(
24832 path,
24833 Page.get_text,
24834 pagefn_kwargs=args_dict,
24835 pages=pages,

Callers

nothing calls this directly

Calls 1

apply_pagesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…