pdfplumber API Reference
Full documentation for pdfplumber (0.11.10)
pdfplumber.PDF
Python Library Documentation: class PDF in module pdfplumber.pdf
class PDF(pdfplumber.container.Container)
| PDF(stream: Union[_io.BufferedReader, _io.BytesIO], stream_is_external: bool = False, path: Optional[pathlib.Path] = None, pages: Union[List[int], Tuple[int], NoneType] = None, laparams: Optional[Dict[str, Any]] = None, password: Optional[str] = None, strict_metadata: bool = False, unicode_norm: Optional[Literal['NFC', 'NFKC', 'NFD', 'NFKD']] = None, raise_unicode_errors: bool = True)
|
| Method resolution order:
| PDF
| pdfplumber.container.Container
| builtins.object
|
| Methods defined here:
|
| __enter__(self) -> 'PDF'
|
| __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[traceback]) -> None
|
| __init__(self, stream: Union[_io.BufferedReader, _io.BytesIO], stream_is_external: bool = False, path: Optional[pathlib.Path] = None, pages: Union[List[int], Tuple[int], NoneType] = None, laparams: Optional[Dict[str, Any]] = None, password: Optional[str] = None, strict_metadata: bool = False, unicode_norm: Optional[Literal['NFC', 'NFKC', 'NFD', 'NFKD']] = None, raise_unicode_errors: bool = True)
| Initialize self. See help(type(self)) for accurate signature.
|
| close(self) -> None
|
| to_dict(self, object_types: Optional[List[str]] = None) -> Dict[str, Any]
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| open(path_or_fp: Union[str, pathlib.Path, _io.BufferedReader, _io.BytesIO], pages: Union[List[int], Tuple[int], NoneType] = None, laparams: Optional[Dict[str, Any]] = None, password: Optional[str] = None, strict_metadata: bool = False, unicode_norm: Optional[Literal['NFC', 'NFKC', 'NFD', 'NFKD']] = None, repair: bool = False, gs_path: Union[str, pathlib.Path, NoneType] = None, repair_setting: Literal['default', 'prepress', 'printer', 'ebook', 'screen'] = 'default', raise_unicode_errors: bool = True) -> 'PDF'
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| annots
|
| hyperlinks
|
| objects
|
| pages
|
| structure_tree
| Return the structure tree for the document.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'cached_properties': typing.List[str]}
|
| cached_properties = ['_rect_edges', '_curve_edges', '_edges', '_object...
|
| ----------------------------------------------------------------------
| Methods inherited from pdfplumber.container.Container:
|
| flush_cache(self, properties: Optional[List[str]] = None) -> None
|
| to_csv(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Optional[str]
|
| to_json(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None, precision: Optional[int] = None, indent: Optional[int] = None) -> Optional[str]
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pdfplumber.container.Container:
|
| chars
|
| curve_edges
|
| curves
|
| edges
|
| horizontal_edges
|
| images
|
| lines
|
| rect_edges
|
| rects
|
| textboxhorizontals
|
| textboxverticals
|
| textlinehorizontals
|
| textlineverticals
|
| vertical_edges
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pdfplumber.container.Container:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
pdfplumber.container
Python Library Documentation: module pdfplumber.container in pdfplumber
NAME
pdfplumber.container
CLASSES
builtins.object
Container
class Container(builtins.object)
| Methods defined here:
|
| flush_cache(self, properties: Optional[List[str]] = None) -> None
|
| to_csv(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Optional[str]
|
| to_dict(self, object_types: Optional[List[str]] = None) -> Dict[str, Any]
|
| to_json(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None, precision: Optional[int] = None, indent: Optional[int] = None) -> Optional[str]
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| chars
|
| curve_edges
|
| curves
|
| edges
|
| horizontal_edges
|
| images
|
| lines
|
| objects
|
| pages
|
| rect_edges
|
| rects
|
| textboxhorizontals
|
| textboxverticals
|
| textlinehorizontals
|
| textlineverticals
|
| vertical_edges
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {}
|
| cached_properties = ['_rect_edges', '_curve_edges', '_edges', '_object...
DATA
CSV_COLS_REQUIRED = ['object_type']
CSV_COLS_TO_PREPEND = ['page_number', 'x0', 'x1', 'y0', 'y1', 'doctop'...
Dict = typing.Dict
A generic version of dict.
List = typing.List
A generic version of list.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
Set = typing.Set
A generic version of set.
T_obj = typing.Dict[str, typing.Any]
T_obj_list = typing.List[typing.Dict[str, typing.Any]]
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfplumber\container.py
pdfplumber.convert
Python Library Documentation: module pdfplumber.convert in pdfplumber
NAME
pdfplumber.convert
CLASSES
builtins.object
Serializer
class Serializer(builtins.object)
| Serializer(precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None)
|
| Methods defined here:
|
| __init__(self, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None)
| Initialize self. See help(type(self)) for accurate signature.
|
| do_PDFStream(self, obj: Any) -> Dict[str, Optional[str]]
|
| do_PSLiteral(self, obj: pdfminer.psparser.PSLiteral) -> str
|
| do_bool(self, x: bool) -> int
|
| do_bytes(self, obj: bytes) -> Optional[str]
|
| do_dict(self, obj: Dict[str, Any]) -> Dict[str, Any]
|
| do_float(self, x: float) -> float
|
| do_list(self, obj: List[Any]) -> List[Any]
|
| do_tuple(self, obj: Tuple[Any, ...]) -> Tuple[Any, ...]
|
| serialize(self, obj: Any) -> Any
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
FUNCTIONS
get_attr_filter(include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Callable[[str], bool]
to_b64(data: bytes) -> str
DATA
CSV_COLS_REQUIRED = ['object_type']
CSV_COLS_TO_PREPEND = ['page_number', 'x0', 'x1', 'y0', 'y1', 'doctop'...
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
Dict = typing.Dict
A generic version of dict.
ENCODINGS_TO_TRY = ['utf-8', 'latin-1', 'utf-16', 'utf-16le']
List = typing.List
A generic version of list.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfplumber\convert.py
pdfplumber.open
Python Library Documentation: method open in module pdfplumber.pdf open(path_or_fp: Union[str, pathlib.Path, _io.BufferedReader, _io.BytesIO], pages: Union[List[int], Tuple[int], NoneType] = None, laparams: Optional[Dict[str, Any]] = None, password: Optional[str] = None, strict_metadata: bool = False, unicode_norm: Optional[Literal['NFC', 'NFKC', 'NFD', 'NFKD']] = None, repair: bool = False, gs_path: Union[str, pathlib.Path, NoneType] = None, repair_setting: Literal['default', 'prepress', 'printer', 'ebook', 'screen'] = 'default', raise_unicode_errors: bool = True) -> 'PDF' class method of pdfplumber.pdf.PDF
pdfplumber.page
Python Library Documentation: module pdfplumber.page in pdfplumber
NAME
pdfplumber.page
CLASSES
pdfminer.converter.PDFPageAggregator(pdfminer.converter.PDFLayoutAnalyzer)
PDFPageAggregatorWithMarkedContent
pdfplumber.container.Container(builtins.object)
Page
DerivedPage
CroppedPage
FilteredPage
class CroppedPage(DerivedPage)
| CroppedPage(parent_page: pdfplumber.page.Page, crop_bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], crop_fn: Callable[[List[Dict[str, Any]], Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]], List[Dict[str, Any]]] = <function crop_to_bbox at 0x00000186BFA9F420>, relative: bool = False, strict: bool = True)
|
| Method resolution order:
| CroppedPage
| DerivedPage
| Page
| pdfplumber.container.Container
| builtins.object
|
| Methods defined here:
|
| __init__(self, parent_page: pdfplumber.page.Page, crop_bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], crop_fn: Callable[[List[Dict[str, Any]], Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]], List[Dict[str, Any]]] = <function crop_to_bbox at 0x00000186BFA9F420>, relative: bool = False, strict: bool = True)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| objects
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from DerivedPage:
|
| is_original = False
|
| ----------------------------------------------------------------------
| Methods inherited from Page:
|
| __repr__(self) -> str
| Return repr(self).
|
| close(self) -> None
|
| crop(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
|
| debug_tablefinder(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> pdfplumber.table.TableFinder
|
| dedupe_chars(self, **kwargs: Any) -> 'FilteredPage'
| Removes duplicate chars — those sharing the same text and positioning
| (within `tolerance`) as other characters in the set. Adjust extra_args
| to be more/less restrictive with the properties checked.
|
| extract_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[List[List[Optional[str]]]]
|
| extract_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[List[List[Optional[str]]]]
|
| extract_text(self, **kwargs: Any) -> str
|
| extract_text_lines(self, strip: bool = True, return_chars: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| extract_text_simple(self, **kwargs: Any) -> str
|
| extract_words(self, **kwargs: Any) -> List[Dict[str, Any]]
|
| filter(self, test_function: Callable[[Dict[str, Any]], bool]) -> 'FilteredPage'
|
| find_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[pdfplumber.table.Table]
|
| find_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[pdfplumber.table.Table]
|
| iter_layout_objects(self, layout_objects: List[pdfminer.layout.LTComponent]) -> Generator[Dict[str, Any], NoneType, NoneType]
|
| outside_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| parse_objects(self) -> Dict[str, List[Dict[str, Any]]]
|
| point2coord(self, pt: Tuple[Union[int, float], Union[int, float]]) -> Tuple[Union[int, float], Union[int, float]]
|
| process_object(self, obj: pdfminer.layout.LTItem) -> Dict[str, Any]
|
| search(self, pattern: Union[str, Pattern[str]], regex: bool = True, case: bool = True, main_group: int = 0, return_chars: bool = True, return_groups: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| to_dict(self, object_types: Optional[List[str]] = None) -> Dict[str, Any]
|
| to_image(self, resolution: Union[int, float, NoneType] = None, width: Union[int, float, NoneType] = None, height: Union[int, float, NoneType] = None, antialias: bool = False, force_mediabox: bool = False) -> 'PageImage'
| You can pass a maximum of 1 of the following:
| - resolution: The desired number pixels per inch. Defaults to 72.
| - width: The desired image width in pixels.
| - height: The desired image width in pixels.
|
| within_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| ----------------------------------------------------------------------
| Readonly properties inherited from Page:
|
| annots
|
| height
|
| hyperlinks
|
| layout
|
| structure_tree
| Return the structure tree for a page, if any.
|
| width
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Page:
|
| cached_properties = ['_rect_edges', '_curve_edges', '_edges', '_object...
|
| pages = None
|
| ----------------------------------------------------------------------
| Methods inherited from pdfplumber.container.Container:
|
| flush_cache(self, properties: Optional[List[str]] = None) -> None
|
| to_csv(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Optional[str]
|
| to_json(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None, precision: Optional[int] = None, indent: Optional[int] = None) -> Optional[str]
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pdfplumber.container.Container:
|
| chars
|
| curve_edges
|
| curves
|
| edges
|
| horizontal_edges
|
| images
|
| lines
|
| rect_edges
|
| rects
|
| textboxhorizontals
|
| textboxverticals
|
| textlinehorizontals
|
| textlineverticals
|
| vertical_edges
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pdfplumber.container.Container:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class DerivedPage(Page)
| DerivedPage(parent_page: pdfplumber.page.Page)
|
| Method resolution order:
| DerivedPage
| Page
| pdfplumber.container.Container
| builtins.object
|
| Methods defined here:
|
| __init__(self, parent_page: pdfplumber.page.Page)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'is_original': <class 'bool'>}
|
| is_original = False
|
| ----------------------------------------------------------------------
| Methods inherited from Page:
|
| __repr__(self) -> str
| Return repr(self).
|
| close(self) -> None
|
| crop(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
|
| debug_tablefinder(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> pdfplumber.table.TableFinder
|
| dedupe_chars(self, **kwargs: Any) -> 'FilteredPage'
| Removes duplicate chars — those sharing the same text and positioning
| (within `tolerance`) as other characters in the set. Adjust extra_args
| to be more/less restrictive with the properties checked.
|
| extract_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[List[List[Optional[str]]]]
|
| extract_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[List[List[Optional[str]]]]
|
| extract_text(self, **kwargs: Any) -> str
|
| extract_text_lines(self, strip: bool = True, return_chars: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| extract_text_simple(self, **kwargs: Any) -> str
|
| extract_words(self, **kwargs: Any) -> List[Dict[str, Any]]
|
| filter(self, test_function: Callable[[Dict[str, Any]], bool]) -> 'FilteredPage'
|
| find_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[pdfplumber.table.Table]
|
| find_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[pdfplumber.table.Table]
|
| iter_layout_objects(self, layout_objects: List[pdfminer.layout.LTComponent]) -> Generator[Dict[str, Any], NoneType, NoneType]
|
| outside_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| parse_objects(self) -> Dict[str, List[Dict[str, Any]]]
|
| point2coord(self, pt: Tuple[Union[int, float], Union[int, float]]) -> Tuple[Union[int, float], Union[int, float]]
|
| process_object(self, obj: pdfminer.layout.LTItem) -> Dict[str, Any]
|
| search(self, pattern: Union[str, Pattern[str]], regex: bool = True, case: bool = True, main_group: int = 0, return_chars: bool = True, return_groups: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| to_dict(self, object_types: Optional[List[str]] = None) -> Dict[str, Any]
|
| to_image(self, resolution: Union[int, float, NoneType] = None, width: Union[int, float, NoneType] = None, height: Union[int, float, NoneType] = None, antialias: bool = False, force_mediabox: bool = False) -> 'PageImage'
| You can pass a maximum of 1 of the following:
| - resolution: The desired number pixels per inch. Defaults to 72.
| - width: The desired image width in pixels.
| - height: The desired image width in pixels.
|
| within_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| ----------------------------------------------------------------------
| Readonly properties inherited from Page:
|
| annots
|
| height
|
| hyperlinks
|
| layout
|
| objects
|
| structure_tree
| Return the structure tree for a page, if any.
|
| width
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Page:
|
| cached_properties = ['_rect_edges', '_curve_edges', '_edges', '_object...
|
| pages = None
|
| ----------------------------------------------------------------------
| Methods inherited from pdfplumber.container.Container:
|
| flush_cache(self, properties: Optional[List[str]] = None) -> None
|
| to_csv(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Optional[str]
|
| to_json(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None, precision: Optional[int] = None, indent: Optional[int] = None) -> Optional[str]
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pdfplumber.container.Container:
|
| chars
|
| curve_edges
|
| curves
|
| edges
|
| horizontal_edges
|
| images
|
| lines
|
| rect_edges
|
| rects
|
| textboxhorizontals
|
| textboxverticals
|
| textlinehorizontals
|
| textlineverticals
|
| vertical_edges
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pdfplumber.container.Container:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class FilteredPage(DerivedPage)
| FilteredPage(parent_page: pdfplumber.page.Page, filter_fn: Callable[[Dict[str, Any]], bool])
|
| Method resolution order:
| FilteredPage
| DerivedPage
| Page
| pdfplumber.container.Container
| builtins.object
|
| Methods defined here:
|
| __init__(self, parent_page: pdfplumber.page.Page, filter_fn: Callable[[Dict[str, Any]], bool])
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| objects
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from DerivedPage:
|
| is_original = False
|
| ----------------------------------------------------------------------
| Methods inherited from Page:
|
| __repr__(self) -> str
| Return repr(self).
|
| close(self) -> None
|
| crop(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
|
| debug_tablefinder(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> pdfplumber.table.TableFinder
|
| dedupe_chars(self, **kwargs: Any) -> 'FilteredPage'
| Removes duplicate chars — those sharing the same text and positioning
| (within `tolerance`) as other characters in the set. Adjust extra_args
| to be more/less restrictive with the properties checked.
|
| extract_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[List[List[Optional[str]]]]
|
| extract_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[List[List[Optional[str]]]]
|
| extract_text(self, **kwargs: Any) -> str
|
| extract_text_lines(self, strip: bool = True, return_chars: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| extract_text_simple(self, **kwargs: Any) -> str
|
| extract_words(self, **kwargs: Any) -> List[Dict[str, Any]]
|
| filter(self, test_function: Callable[[Dict[str, Any]], bool]) -> 'FilteredPage'
|
| find_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[pdfplumber.table.Table]
|
| find_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[pdfplumber.table.Table]
|
| iter_layout_objects(self, layout_objects: List[pdfminer.layout.LTComponent]) -> Generator[Dict[str, Any], NoneType, NoneType]
|
| outside_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| parse_objects(self) -> Dict[str, List[Dict[str, Any]]]
|
| point2coord(self, pt: Tuple[Union[int, float], Union[int, float]]) -> Tuple[Union[int, float], Union[int, float]]
|
| process_object(self, obj: pdfminer.layout.LTItem) -> Dict[str, Any]
|
| search(self, pattern: Union[str, Pattern[str]], regex: bool = True, case: bool = True, main_group: int = 0, return_chars: bool = True, return_groups: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| to_dict(self, object_types: Optional[List[str]] = None) -> Dict[str, Any]
|
| to_image(self, resolution: Union[int, float, NoneType] = None, width: Union[int, float, NoneType] = None, height: Union[int, float, NoneType] = None, antialias: bool = False, force_mediabox: bool = False) -> 'PageImage'
| You can pass a maximum of 1 of the following:
| - resolution: The desired number pixels per inch. Defaults to 72.
| - width: The desired image width in pixels.
| - height: The desired image width in pixels.
|
| within_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| ----------------------------------------------------------------------
| Readonly properties inherited from Page:
|
| annots
|
| height
|
| hyperlinks
|
| layout
|
| structure_tree
| Return the structure tree for a page, if any.
|
| width
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Page:
|
| cached_properties = ['_rect_edges', '_curve_edges', '_edges', '_object...
|
| pages = None
|
| ----------------------------------------------------------------------
| Methods inherited from pdfplumber.container.Container:
|
| flush_cache(self, properties: Optional[List[str]] = None) -> None
|
| to_csv(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Optional[str]
|
| to_json(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None, precision: Optional[int] = None, indent: Optional[int] = None) -> Optional[str]
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pdfplumber.container.Container:
|
| chars
|
| curve_edges
|
| curves
|
| edges
|
| horizontal_edges
|
| images
|
| lines
|
| rect_edges
|
| rects
|
| textboxhorizontals
|
| textboxverticals
|
| textlinehorizontals
|
| textlineverticals
|
| vertical_edges
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pdfplumber.container.Container:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class PDFPageAggregatorWithMarkedContent(pdfminer.converter.PDFPageAggregator)
| PDFPageAggregatorWithMarkedContent(rsrcmgr: pdfminer.pdfinterp.PDFResourceManager, pageno: int = 1, laparams: pdfminer.layout.LAParams | None = None) -> None
|
| Extract layout from a specific page, adding marked-content IDs to
| objects where found.
|
| Method resolution order:
| PDFPageAggregatorWithMarkedContent
| pdfminer.converter.PDFPageAggregator
| pdfminer.converter.PDFLayoutAnalyzer
| pdfminer.pdfdevice.PDFTextDevice
| pdfminer.pdfdevice.PDFDevice
| builtins.object
|
| Methods defined here:
|
| begin_tag(self, tag: pdfminer.psparser.PSLiteral, props: Union[str, float, bool, pdfminer.psparser.PSLiteral, bytes, list[Any], dict[Any, Any], pdfminer.pdftypes.PDFStream, NoneType] = None) -> None
| Handle beginning of tag, setting current MCID if any.
|
| end_tag(self) -> None
| Handle beginning of tag, clearing current MCID.
|
| paint_path(self, *args, **kwargs) -> None
| Hook for rendering lines and curves, adding the `mcid` attribute.
|
| render_char(self, *args, **kwargs) -> float
| Hook for rendering characters, adding the `mcid` attribute.
|
| render_image(self, *args, **kwargs) -> None
| Hook for rendering images, adding the `mcid` attribute.
|
| tag_cur_item(self) -> None
| Add current MCID to what we hope to be the most recent object created
| by pdfminer.six.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'cur_mcid': typing.Optional[int], 'cur_tag': typing...
|
| cur_mcid = None
|
| cur_tag = None
|
| ----------------------------------------------------------------------
| Methods inherited from pdfminer.converter.PDFPageAggregator:
|
| __init__(self, rsrcmgr: pdfminer.pdfinterp.PDFResourceManager, pageno: int = 1, laparams: pdfminer.layout.LAParams | None = None) -> None
| Initialize self. See help(type(self)) for accurate signature.
|
| get_result(self) -> pdfminer.layout.LTPage
|
| receive_layout(self, ltpage: pdfminer.layout.LTPage) -> None
|
| ----------------------------------------------------------------------
| Methods inherited from pdfminer.converter.PDFLayoutAnalyzer:
|
| begin_figure(self, name: str, bbox: tuple[float, float, float, float], matrix: tuple[float, float, float, float, float, float]) -> None
|
| begin_page(self, page: pdfminer.pdfpage.PDFPage, ctm: tuple[float, float, float, float, float, float]) -> None
|
| end_figure(self, _: str) -> None
|
| end_page(self, page: pdfminer.pdfpage.PDFPage) -> None
|
| handle_undefined_char(self, font: pdfminer.pdffont.PDFFont, cid: int) -> str
|
| ----------------------------------------------------------------------
| Methods inherited from pdfminer.pdfdevice.PDFTextDevice:
|
| render_string(self, textstate: 'PDFTextState', seq: collections.abc.Iterable[int | float | bytes], ncs: pdfminer.pdfcolor.PDFColorSpace, graphicstate: 'PDFGraphicState') -> None
|
| render_string_horizontal(self, seq: collections.abc.Iterable[int | float | bytes], matrix: tuple[float, float, float, float, float, float], pos: tuple[float, float], font: pdfminer.pdffont.PDFFont, fontsize: float, scaling: float, charspace: float, wordspace: float, rise: float, dxscale: float, ncs: pdfminer.pdfcolor.PDFColorSpace, graphicstate: 'PDFGraphicState') -> tuple[float, float]
|
| render_string_vertical(self, seq: collections.abc.Iterable[int | float | bytes], matrix: tuple[float, float, float, float, float, float], pos: tuple[float, float], font: pdfminer.pdffont.PDFFont, fontsize: float, scaling: float, charspace: float, wordspace: float, rise: float, dxscale: float, ncs: pdfminer.pdfcolor.PDFColorSpace, graphicstate: 'PDFGraphicState') -> tuple[float, float]
|
| ----------------------------------------------------------------------
| Methods inherited from pdfminer.pdfdevice.PDFDevice:
|
| __enter__(self) -> 'PDFDevice'
|
| __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> None
|
| __repr__(self) -> str
| Return repr(self).
|
| close(self) -> None
|
| do_tag(self, tag: pdfminer.psparser.PSLiteral, props: Optional[ForwardRef('PDFStackT')] = None) -> None
|
| set_ctm(self, ctm: tuple[float, float, float, float, float, float]) -> None
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pdfminer.pdfdevice.PDFDevice:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class Page(pdfplumber.container.Container)
| Page(pdf: 'PDF', page_obj: pdfminer.pdfpage.PDFPage, page_number: int, initial_doctop: Union[int, float] = 0)
|
| Method resolution order:
| Page
| pdfplumber.container.Container
| builtins.object
|
| Methods defined here:
|
| __init__(self, pdf: 'PDF', page_obj: pdfminer.pdfpage.PDFPage, page_number: int, initial_doctop: Union[int, float] = 0)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> str
| Return repr(self).
|
| close(self) -> None
|
| crop(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
|
| debug_tablefinder(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> pdfplumber.table.TableFinder
|
| dedupe_chars(self, **kwargs: Any) -> 'FilteredPage'
| Removes duplicate chars — those sharing the same text and positioning
| (within `tolerance`) as other characters in the set. Adjust extra_args
| to be more/less restrictive with the properties checked.
|
| extract_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[List[List[Optional[str]]]]
|
| extract_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[List[List[Optional[str]]]]
|
| extract_text(self, **kwargs: Any) -> str
|
| extract_text_lines(self, strip: bool = True, return_chars: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| extract_text_simple(self, **kwargs: Any) -> str
|
| extract_words(self, **kwargs: Any) -> List[Dict[str, Any]]
|
| filter(self, test_function: Callable[[Dict[str, Any]], bool]) -> 'FilteredPage'
|
| find_table(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> Optional[pdfplumber.table.Table]
|
| find_tables(self, table_settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None) -> List[pdfplumber.table.Table]
|
| iter_layout_objects(self, layout_objects: List[pdfminer.layout.LTComponent]) -> Generator[Dict[str, Any], NoneType, NoneType]
|
| outside_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| parse_objects(self) -> Dict[str, List[Dict[str, Any]]]
|
| point2coord(self, pt: Tuple[Union[int, float], Union[int, float]]) -> Tuple[Union[int, float], Union[int, float]]
|
| process_object(self, obj: pdfminer.layout.LTItem) -> Dict[str, Any]
|
| search(self, pattern: Union[str, Pattern[str]], regex: bool = True, case: bool = True, main_group: int = 0, return_chars: bool = True, return_groups: bool = True, **kwargs: Any) -> List[Dict[str, Any]]
|
| to_dict(self, object_types: Optional[List[str]] = None) -> Dict[str, Any]
|
| to_image(self, resolution: Union[int, float, NoneType] = None, width: Union[int, float, NoneType] = None, height: Union[int, float, NoneType] = None, antialias: bool = False, force_mediabox: bool = False) -> 'PageImage'
| You can pass a maximum of 1 of the following:
| - resolution: The desired number pixels per inch. Defaults to 72.
| - width: The desired image width in pixels.
| - height: The desired image width in pixels.
|
| within_bbox(self, bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], relative: bool = False, strict: bool = True) -> 'CroppedPage'
| Same as .crop, except only includes objects fully within the bbox
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| annots
|
| height
|
| hyperlinks
|
| layout
|
| objects
|
| structure_tree
| Return the structure tree for a page, if any.
|
| width
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'cached_properties': typing.List[str], 'is_original...
|
| cached_properties = ['_rect_edges', '_curve_edges', '_edges', '_object...
|
| is_original = True
|
| pages = None
|
| ----------------------------------------------------------------------
| Methods inherited from pdfplumber.container.Container:
|
| flush_cache(self, properties: Optional[List[str]] = None) -> None
|
| to_csv(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Optional[str]
|
| to_json(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None, precision: Optional[int] = None, indent: Optional[int] = None) -> Optional[str]
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pdfplumber.container.Container:
|
| chars
|
| curve_edges
|
| curves
|
| edges
|
| horizontal_edges
|
| images
|
| lines
|
| rect_edges
|
| rects
|
| textboxhorizontals
|
| textboxverticals
|
| textlinehorizontals
|
| textlineverticals
|
| vertical_edges
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pdfplumber.container.Container:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
FUNCTIONS
fix_fontname_bytes(fontname: bytes) -> str
normalize_unicode = normalize(form, unistr, /)
Return the normal form 'form' for the Unicode string unistr.
Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.
test_proposed_bbox(bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]], parent_bbox: Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]) -> None
tuplify_list_kwargs(kwargs: Dict[str, Any]) -> Dict[str, Any]
warn(...)
Issue a warning, or maybe ignore it or raise an exception.
message
Text of the warning message.
category
The Warning category subclass. Defaults to UserWarning.
stacklevel
How far up the call stack to make this warning appear. A value of 2 for
example attributes the warning to the caller of the code calling warn().
source
If supplied, the destroyed object which emitted a ResourceWarning
skip_file_prefixes
An optional tuple of module filename prefixes indicating frames to skip
during stacklevel computations for stack frame attribution.
DATA
ALL_ATTRS = {'adv', 'bits', 'colorspace', 'evenodd', 'fill', 'fontname...
CP936_FONTNAMES = {b'\xb7\xc2\xcb\xce_GB2312': 'SimFang,Regular', b'\x...
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
Dict = typing.Dict
A generic version of dict.
Generator = typing.Generator
A generic version of collections.abc.Generator.
List = typing.List
A generic version of list.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
PDFStackT = typing.Union[str, float, bool, pdfminer.psparser...ng.Any,...
Pattern = typing.Pattern
A generic version of re.Pattern.
TYPE_CHECKING = False
T_bbox = typing.Tuple[typing.Union[int, float], typing.Un...ping.Union...
T_num = typing.Union[int, float]
T_obj = typing.Dict[str, typing.Any]
T_obj_list = typing.List[typing.Dict[str, typing.Any]]
T_table_settings = typing.Union[ForwardRef('TableSettings'), typing.Di...
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
lt_pat = re.compile('^LT')
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfplumber\page.py
pdfplumber.pdf
Python Library Documentation: module pdfplumber.pdf in pdfplumber
NAME
pdfplumber.pdf
CLASSES
pdfplumber.container.Container(builtins.object)
PDF
class PDF(pdfplumber.container.Container)
| PDF(stream: Union[_io.BufferedReader, _io.BytesIO], stream_is_external: bool = False, path: Optional[pathlib.Path] = None, pages: Union[List[int], Tuple[int], NoneType] = None, laparams: Optional[Dict[str, Any]] = None, password: Optional[str] = None, strict_metadata: bool = False, unicode_norm: Optional[Literal['NFC', 'NFKC', 'NFD', 'NFKD']] = None, raise_unicode_errors: bool = True)
|
| Method resolution order:
| PDF
| pdfplumber.container.Container
| builtins.object
|
| Methods defined here:
|
| __enter__(self) -> 'PDF'
|
| __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[traceback]) -> None
|
| __init__(self, stream: Union[_io.BufferedReader, _io.BytesIO], stream_is_external: bool = False, path: Optional[pathlib.Path] = None, pages: Union[List[int], Tuple[int], NoneType] = None, laparams: Optional[Dict[str, Any]] = None, password: Optional[str] = None, strict_metadata: bool = False, unicode_norm: Optional[Literal['NFC', 'NFKC', 'NFD', 'NFKD']] = None, raise_unicode_errors: bool = True)
| Initialize self. See help(type(self)) for accurate signature.
|
| close(self) -> None
|
| to_dict(self, object_types: Optional[List[str]] = None) -> Dict[str, Any]
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| open(path_or_fp: Union[str, pathlib.Path, _io.BufferedReader, _io.BytesIO], pages: Union[List[int], Tuple[int], NoneType] = None, laparams: Optional[Dict[str, Any]] = None, password: Optional[str] = None, strict_metadata: bool = False, unicode_norm: Optional[Literal['NFC', 'NFKC', 'NFD', 'NFKD']] = None, repair: bool = False, gs_path: Union[str, pathlib.Path, NoneType] = None, repair_setting: Literal['default', 'prepress', 'printer', 'ebook', 'screen'] = 'default', raise_unicode_errors: bool = True) -> 'PDF'
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| annots
|
| hyperlinks
|
| objects
|
| pages
|
| structure_tree
| Return the structure tree for the document.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'cached_properties': typing.List[str]}
|
| cached_properties = ['_rect_edges', '_curve_edges', '_edges', '_object...
|
| ----------------------------------------------------------------------
| Methods inherited from pdfplumber.container.Container:
|
| flush_cache(self, properties: Optional[List[str]] = None) -> None
|
| to_csv(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, precision: Optional[int] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None) -> Optional[str]
|
| to_json(self, stream: Optional[TextIO] = None, object_types: Optional[List[str]] = None, include_attrs: Optional[List[str]] = None, exclude_attrs: Optional[List[str]] = None, precision: Optional[int] = None, indent: Optional[int] = None) -> Optional[str]
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pdfplumber.container.Container:
|
| chars
|
| curve_edges
|
| curves
|
| edges
|
| horizontal_edges
|
| images
|
| lines
|
| rect_edges
|
| rects
|
| textboxhorizontals
|
| textboxverticals
|
| textlinehorizontals
|
| textlineverticals
|
| vertical_edges
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pdfplumber.container.Container:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
DATA
Dict = typing.Dict
A generic version of dict.
Generator = typing.Generator
A generic version of collections.abc.Generator.
List = typing.List
A generic version of list.
Literal = typing.Literal
Special typing form to define literal types (a.k.a. value types).
This form can be used to indicate to type checkers that the corresponding
variable or function parameter has a value equivalent to the provided
literal (or one of several literals)::
def validate_simple(data: Any) -> Literal[True]: # always returns True
...
MODE = Literal['r', 'rb', 'w', 'wb']
def open_helper(file: str, mode: MODE) -> str:
...
open_helper('/some/path', 'r') # Passes type check
open_helper('/other/path', 'typo') # Error in type checker
Literal[...] cannot be subclassed. At runtime, an arbitrary value
is allowed as type argument to Literal[...], but type checkers may
impose restrictions.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
T_num = typing.Union[int, float]
T_obj_list = typing.List[typing.Dict[str, typing.Any]]
T_repair_setting = typing.Literal['default', 'prepress', 'printer', 'e...
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Type = typing.Type
Deprecated alias to builtins.type.
builtins.type or typing.Type can be used to annotate class objects.
For example, suppose we have the following classes::
class User: ... # Abstract base for User classes
class BasicUser(User): ...
class ProUser(User): ...
class TeamUser(User): ...
And a function that takes a class argument that's a subclass of
User and returns an instance of the corresponding class::
def new_user[U](user_class: Type[U]) -> U:
user = user_class()
# (Here we could write the user object to a database)
return user
joe = new_user(BasicUser)
At this point the type checker knows that joe has type BasicUser.
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
logger = <Logger pdfplumber.pdf (WARNING)>
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfplumber\pdf.py
pdfplumber.pdfminer
Python Library Documentation: package pdfminer
NAME
pdfminer
PACKAGE CONTENTS
_saslprep
arcfour
ascii85
casting
ccitt
cmapdb
converter
data_structures
encodingdb
fontmetrics
glyphlist
high_level
image
jbig2
latin_enc
layout
lzw
pdfcolor
pdfdevice
pdfdocument
pdfexceptions
pdffont
pdfinterp
pdfpage
pdfparser
pdftypes
psexceptions
psparser
runlength
settings
utils
VERSION
20260107
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfminer\__init__.py
pdfplumber.repair
Python Library Documentation: function repair in module pdfplumber.repair repair(path_or_fp: Union[str, pathlib.Path, _io.BufferedReader, _io.BytesIO], outfile: Union[str, pathlib.Path, NoneType] = None, password: Optional[str] = None, gs_path: Union[str, pathlib.Path, NoneType] = None, setting: Literal['default', 'prepress', 'printer', 'ebook', 'screen'] = 'default') -> Optional[_io.BytesIO]
pdfplumber.structure
Python Library Documentation: module pdfplumber.structure in pdfplumber
NAME
pdfplumber.structure
CLASSES
builtins.ValueError(builtins.Exception)
StructTreeMissing
builtins.object
Findable
PDFStructElement
PDFStructTree
class Findable(builtins.object)
| find() and find_all() methods that can be inherited to avoid
| repeating oneself
|
| Methods defined here:
|
| find(self, matcher: Union[str, Pattern[str], Callable[[ForwardRef('PDFStructElement')], bool]]) -> Optional[ForwardRef('PDFStructElement')]
| Find the first matching element in subtree.
|
| The `matcher` argument is either an element name, a regular
| expression, or a function taking a `PDFStructElement` and
| returning `True` if the element matches.
|
| find_all(self, matcher: Union[str, Pattern[str], Callable[[ForwardRef('PDFStructElement')], bool]]) -> Iterator[ForwardRef('PDFStructElement')]
| Iterate depth-first over matching elements in subtree.
|
| The `matcher` argument is either an element name, a regular
| expression, or a function taking a `PDFStructElement` and
| returning `True` if the element matches.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'children': typing.List[ForwardRef('PDFStructElemen...
class PDFStructElement(Findable)
| PDFStructElement(type: str, revision: Optional[int], id: Optional[str], lang: Optional[str], alt_text: Optional[str], actual_text: Optional[str], title: Optional[str], page_number: Optional[int], attributes: Dict[str, Any] = <factory>, mcids: List[int] = <factory>, children: List[ForwardRef('PDFStructElement')] = <factory>) -> None
|
| PDFStructElement(type: str, revision: Optional[int], id: Optional[str], lang: Optional[str], alt_text: Optional[str], actual_text: Optional[str], title: Optional[str], page_number: Optional[int], attributes: Dict[str, Any] = <factory>, mcids: List[int] = <factory>, children: List[ForwardRef('PDFStructElement')] = <factory>)
|
| Method resolution order:
| PDFStructElement
| Findable
| builtins.object
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, type: str, revision: Optional[int], id: Optional[str], lang: Optional[str], alt_text: Optional[str], actual_text: Optional[str], title: Optional[str], page_number: Optional[int], attributes: Dict[str, Any] = <factory>, mcids: List[int] = <factory>, children: List[ForwardRef('PDFStructElement')] = <factory>) -> None
| Initialize self. See help(type(self)) for accurate signature.
|
| __iter__(self) -> Iterator[ForwardRef('PDFStructElement')]
|
| __repr__(self)
| Return repr(self).
|
| all_mcids(self) -> Iterator[Tuple[Optional[int], int]]
| Collect all MCIDs (with their page numbers, if there are
| multiple pages in the tree) inside a structure element.
|
| to_dict(self) -> Dict[str, Any]
| Return a compacted dict representation.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'actual_text': typing.Optional[str], 'alt_text': ty...
|
| __dataclass_fields__ = {'actual_text': Field(name='actual_text',type=t...
|
| __dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,or...
|
| __hash__ = None
|
| __match_args__ = ('type', 'revision', 'id', 'lang', 'alt_text', 'actua...
|
| ----------------------------------------------------------------------
| Methods inherited from Findable:
|
| find(self, matcher: Union[str, Pattern[str], Callable[[ForwardRef('PDFStructElement')], bool]]) -> Optional[ForwardRef('PDFStructElement')]
| Find the first matching element in subtree.
|
| The `matcher` argument is either an element name, a regular
| expression, or a function taking a `PDFStructElement` and
| returning `True` if the element matches.
|
| find_all(self, matcher: Union[str, Pattern[str], Callable[[ForwardRef('PDFStructElement')], bool]]) -> Iterator[ForwardRef('PDFStructElement')]
| Iterate depth-first over matching elements in subtree.
|
| The `matcher` argument is either an element name, a regular
| expression, or a function taking a `PDFStructElement` and
| returning `True` if the element matches.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Findable:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class PDFStructTree(Findable)
| PDFStructTree(doc: 'PDF', page: Optional[ForwardRef('Page')] = None)
|
| Parse the structure tree of a PDF.
|
| The constructor takes a `pdfplumber.PDF` and optionally a
| `pdfplumber.Page`. To avoid creating the entire tree for a large
| document it is recommended to provide a page.
|
| This class creates a representation of the portion of the
| structure tree that reaches marked content sections, either for a
| single page, or for the whole document. Note that this is slightly
| different from the behaviour of other PDF libraries which will
| also include structure elements with no content.
|
| If the PDF has no structure, the constructor will raise
| `StructTreeMissing`.
|
| Method resolution order:
| PDFStructTree
| Findable
| builtins.object
|
| Methods defined here:
|
| __init__(self, doc: 'PDF', page: Optional[ForwardRef('Page')] = None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __iter__(self) -> Iterator[pdfplumber.structure.PDFStructElement]
|
| element_bbox(self, el: pdfplumber.structure.PDFStructElement) -> Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]
| Get the bounding box for an element for visual debugging.
|
| on_parsed_page(self, obj: Dict[str, Any]) -> bool
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'page': typing.Optional[ForwardRef('Page')]}
|
| ----------------------------------------------------------------------
| Methods inherited from Findable:
|
| find(self, matcher: Union[str, Pattern[str], Callable[[ForwardRef('PDFStructElement')], bool]]) -> Optional[ForwardRef('PDFStructElement')]
| Find the first matching element in subtree.
|
| The `matcher` argument is either an element name, a regular
| expression, or a function taking a `PDFStructElement` and
| returning `True` if the element matches.
|
| find_all(self, matcher: Union[str, Pattern[str], Callable[[ForwardRef('PDFStructElement')], bool]]) -> Iterator[ForwardRef('PDFStructElement')]
| Iterate depth-first over matching elements in subtree.
|
| The `matcher` argument is either an element name, a regular
| expression, or a function taking a `PDFStructElement` and
| returning `True` if the element matches.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Findable:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class StructTreeMissing(builtins.ValueError)
| Method resolution order:
| StructTreeMissing
| builtins.ValueError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.ValueError:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.ValueError:
|
| __new__(*args, **kwargs) class method of builtins.ValueError
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
DATA
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
Dict = typing.Dict
A generic version of dict.
Iterable = typing.Iterable
A generic version of collections.abc.Iterable.
Iterator = typing.Iterator
A generic version of collections.abc.Iterator.
List = typing.List
A generic version of list.
MatchFunc = typing.Callable[[ForwardRef('PDFStructElement')], bool]
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
Pattern = typing.Pattern
A generic version of re.Pattern.
TYPE_CHECKING = False
T_bbox = typing.Tuple[typing.Union[int, float], typing.Un...ping.Union...
T_obj = typing.Dict[str, typing.Any]
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
logger = <Logger pdfplumber.structure (WARNING)>
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfplumber\structure.py
pdfplumber.table
Python Library Documentation: module pdfplumber.table in pdfplumber
NAME
pdfplumber.table
CLASSES
builtins.float(builtins.object)
UnsetFloat
builtins.object
CellGroup
Column
Row
Table
TableFinder
TableSettings
class CellGroup(builtins.object)
| CellGroup(cells: List[Optional[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]])
|
| Methods defined here:
|
| __init__(self, cells: List[Optional[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]])
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class Column(CellGroup)
| Column(cells: List[Optional[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]])
|
| Method resolution order:
| Column
| CellGroup
| builtins.object
|
| Methods inherited from CellGroup:
|
| __init__(self, cells: List[Optional[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]])
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from CellGroup:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class Row(CellGroup)
| Row(cells: List[Optional[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]])
|
| Method resolution order:
| Row
| CellGroup
| builtins.object
|
| Methods inherited from CellGroup:
|
| __init__(self, cells: List[Optional[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]])
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from CellGroup:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class Table(builtins.object)
| Table(page: 'Page', cells: List[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]])
|
| Methods defined here:
|
| __init__(self, page: 'Page', cells: List[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]])
| Initialize self. See help(type(self)) for accurate signature.
|
| extract(self, **kwargs: Any) -> List[List[Optional[str]]]
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| bbox
|
| columns
|
| rows
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class TableFinder(builtins.object)
| TableFinder(page: 'Page', settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None)
|
| Given a PDF page, find plausible table structures.
|
| Largely borrowed from Anssi Nurminen's master's thesis:
| http://dspace.cc.tut.fi/dpub/bitstream/handle/123456789/21520/Nurminen.pdf?sequence=3
|
| ... and inspired by Tabula:
| https://github.com/tabulapdf/tabula-extractor/issues/16
|
| Methods defined here:
|
| __init__(self, page: 'Page', settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType] = None)
| Initialize self. See help(type(self)) for accurate signature.
|
| get_edges(self) -> List[Dict[str, Any]]
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class TableSettings(builtins.object)
| TableSettings(vertical_strategy: str = 'lines', horizontal_strategy: str = 'lines', explicit_vertical_lines: Optional[List[Union[Dict[str, Any], int, float]]] = None, explicit_horizontal_lines: Optional[List[Union[Dict[str, Any], int, float]]] = None, snap_tolerance: Union[int, float] = 3, snap_x_tolerance: Union[int, float] = 0.0, snap_y_tolerance: Union[int, float] = 0.0, join_tolerance: Union[int, float] = 3, join_x_tolerance: Union[int, float] = 0.0, join_y_tolerance: Union[int, float] = 0.0, edge_min_length: Union[int, float] = 3, edge_min_length_prefilter: Union[int, float] = 1, min_words_vertical: int = 3, min_words_horizontal: int = 1, intersection_tolerance: Union[int, float] = 3, intersection_x_tolerance: Union[int, float] = 0.0, intersection_y_tolerance: Union[int, float] = 0.0, text_settings: Optional[Dict[str, Any]] = None) -> None
|
| TableSettings(vertical_strategy: str = 'lines', horizontal_strategy: str = 'lines', explicit_vertical_lines: Optional[List[Union[Dict[str, Any], int, float]]] = None, explicit_horizontal_lines: Optional[List[Union[Dict[str, Any], int, float]]] = None, snap_tolerance: Union[int, float] = 3, snap_x_tolerance: Union[int, float] = 0.0, snap_y_tolerance: Union[int, float] = 0.0, join_tolerance: Union[int, float] = 3, join_x_tolerance: Union[int, float] = 0.0, join_y_tolerance: Union[int, float] = 0.0, edge_min_length: Union[int, float] = 3, edge_min_length_prefilter: Union[int, float] = 1, min_words_vertical: int = 3, min_words_horizontal: int = 1, intersection_tolerance: Union[int, float] = 3, intersection_x_tolerance: Union[int, float] = 0.0, intersection_y_tolerance: Union[int, float] = 0.0, text_settings: Optional[Dict[str, Any]] = None)
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, vertical_strategy: str = 'lines', horizontal_strategy: str = 'lines', explicit_vertical_lines: Optional[List[Union[Dict[str, Any], int, float]]] = None, explicit_horizontal_lines: Optional[List[Union[Dict[str, Any], int, float]]] = None, snap_tolerance: Union[int, float] = 3, snap_x_tolerance: Union[int, float] = 0.0, snap_y_tolerance: Union[int, float] = 0.0, join_tolerance: Union[int, float] = 3, join_x_tolerance: Union[int, float] = 0.0, join_y_tolerance: Union[int, float] = 0.0, edge_min_length: Union[int, float] = 3, edge_min_length_prefilter: Union[int, float] = 1, min_words_vertical: int = 3, min_words_horizontal: int = 1, intersection_tolerance: Union[int, float] = 3, intersection_x_tolerance: Union[int, float] = 0.0, intersection_y_tolerance: Union[int, float] = 0.0, text_settings: Optional[Dict[str, Any]] = None) -> None
| Initialize self. See help(type(self)) for accurate signature.
|
| __post_init__(self) -> None
| Clean up user-provided table settings.
|
| Validates that the table settings provided consists of acceptable values and
| returns a cleaned up version. The cleaned up version fills out the missing
| values with the default values in the provided settings.
|
| TODO: Can be further used to validate that the values are of the correct
| type. For example, raising a value error when a non-boolean input is
| provided for the key ``keep_blank_chars``.
|
| :param table_settings: User-provided table settings.
| :returns: A cleaned up version of the user-provided table settings.
| :raises ValueError: When an unrecognised key is provided.
|
| __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| resolve(settings: Union[ForwardRef('TableSettings'), Dict[str, Any], NoneType]) -> 'TableSettings'
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {'edge_min_length': typing.Union[int, float], 'edge_...
|
| __dataclass_fields__ = {'edge_min_length': Field(name='edge_min_length...
|
| __dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,or...
|
| __hash__ = None
|
| __match_args__ = ('vertical_strategy', 'horizontal_strategy', 'explici...
|
| edge_min_length = 3
|
| edge_min_length_prefilter = 1
|
| explicit_horizontal_lines = None
|
| explicit_vertical_lines = None
|
| horizontal_strategy = 'lines'
|
| intersection_tolerance = 3
|
| intersection_x_tolerance = 0.0
|
| intersection_y_tolerance = 0.0
|
| join_tolerance = 3
|
| join_x_tolerance = 0.0
|
| join_y_tolerance = 0.0
|
| min_words_horizontal = 1
|
| min_words_vertical = 3
|
| snap_tolerance = 3
|
| snap_x_tolerance = 0.0
|
| snap_y_tolerance = 0.0
|
| text_settings = None
|
| vertical_strategy = 'lines'
class UnsetFloat(builtins.float)
| UnsetFloat(x=0, /)
|
| Method resolution order:
| UnsetFloat
| builtins.float
| builtins.object
|
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.float:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __bool__(self, /)
| True if self else False
|
| __ceil__(self, /)
| Return the ceiling as an Integral.
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
| __eq__(self, value, /)
| Return self==value.
|
| __float__(self, /)
| float(self)
|
| __floor__(self, /)
| Return the floor as an Integral.
|
| __floordiv__(self, value, /)
| Return self//value.
|
| __format__(self, format_spec, /)
| Formats the float according to format_spec.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getnewargs__(self, /)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __int__(self, /)
| int(self)
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __neg__(self, /)
| -self
|
| __pos__(self, /)
| +self
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
| __radd__(self, value, /)
| Return value+self.
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
| __repr__(self, /)
| Return repr(self).
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __round__(self, ndigits=None, /)
| Return the Integral closest to x, rounding half toward even.
|
| When an argument is passed, work like built-in round(x, ndigits).
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
| __rsub__(self, value, /)
| Return value-self.
|
| __rtruediv__(self, value, /)
| Return value/self.
|
| __sub__(self, value, /)
| Return self-value.
|
| __truediv__(self, value, /)
| Return self/value.
|
| __trunc__(self, /)
| Return the Integral closest to x between 0 and x.
|
| as_integer_ratio(self, /)
| Return a pair of integers, whose ratio is exactly equal to the original float.
|
| The ratio is in lowest terms and has a positive denominator. Raise
| OverflowError on infinities and a ValueError on NaNs.
|
| >>> (10.0).as_integer_ratio()
| (10, 1)
| >>> (0.0).as_integer_ratio()
| (0, 1)
| >>> (-.25).as_integer_ratio()
| (-1, 4)
|
| conjugate(self, /)
| Return self, the complex conjugate of any float.
|
| hex(self, /)
| Return a hexadecimal representation of a floating-point number.
|
| >>> (-0.1).hex()
| '-0x1.999999999999ap-4'
| >>> 3.14159.hex()
| '0x1.921f9f01b866ep+1'
|
| is_integer(self, /)
| Return True if the float is an integer.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.float:
|
| __getformat__(typestr, /)
| You probably don't want to use this function.
|
| typestr
| Must be 'double' or 'float'.
|
| It exists mainly to be used in Python's test suite.
|
| This function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,
| little-endian' best describes the format of floating-point numbers used by the
| C type named by typestr.
|
| fromhex(string, /)
| Create a floating-point number from a hexadecimal string.
|
| >>> float.fromhex('0x1.ffffp10')
| 2047.984375
| >>> float.fromhex('-0x1p-1074')
| -5e-324
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.float:
|
| __new__(*args, **kwargs) class method of builtins.float
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.float:
|
| imag
| the imaginary part of a complex number
|
| real
| the real part of a complex number
FUNCTIONS
cells_to_tables(cells: List[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]) -> List[List[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]]
Given a list of bounding boxes (`cells`), return a list of tables that
hold those cells most simply (and contiguously).
edges_to_intersections(edges: List[Dict[str, Any]], x_tolerance: Union[int, float] = 1, y_tolerance: Union[int, float] = 1) -> Dict[Tuple[Union[int, float], Union[int, float]], Dict[str, List[Dict[str, Any]]]]
Given a list of edges, return the points at which they intersect
within `tolerance` pixels.
intersections_to_cells(intersections: Dict[Tuple[Union[int, float], Union[int, float]], Dict[str, List[Dict[str, Any]]]]) -> List[Tuple[Union[int, float], Union[int, float], Union[int, float], Union[int, float]]]
Given a list of points (`intersections`), return all rectangular "cells"
that those points describe.
`intersections` should be a dictionary with (x0, top) tuples as keys,
and a list of edge objects as values. The edge objects should correspond
to the edges that touch the intersection.
join_edge_group(edges: Iterable[Dict[str, Any]], orientation: str, tolerance: Union[int, float] = 3) -> List[Dict[str, Any]]
Given a list of edges along the same infinite line, join those that
are within `tolerance` pixels of one another.
merge_edges(edges: List[Dict[str, Any]], snap_x_tolerance: Union[int, float], snap_y_tolerance: Union[int, float], join_x_tolerance: Union[int, float], join_y_tolerance: Union[int, float]) -> List[Dict[str, Any]]
Using the `snap_edges` and `join_edge_group` methods above,
merge a list of edges into a more "seamless" list.
snap_edges(edges: List[Dict[str, Any]], x_tolerance: Union[int, float] = 3, y_tolerance: Union[int, float] = 3) -> List[Dict[str, Any]]
Given a list of edges, snap any within `tolerance` pixels of one another
to their positional average.
words_to_edges_h(words: List[Dict[str, Any]], word_threshold: int = 1) -> List[Dict[str, Any]]
Find (imaginary) horizontal lines that connect the tops
of at least `word_threshold` words.
words_to_edges_v(words: List[Dict[str, Any]], word_threshold: int = 3) -> List[Dict[str, Any]]
Find (imaginary) vertical lines that connect the left, right, or
center of at least `word_threshold` words.
DATA
DEFAULT_JOIN_TOLERANCE = 3
DEFAULT_MIN_WORDS_HORIZONTAL = 1
DEFAULT_MIN_WORDS_VERTICAL = 3
DEFAULT_SNAP_TOLERANCE = 3
Dict = typing.Dict
A generic version of dict.
List = typing.List
A generic version of list.
NON_NEGATIVE_SETTINGS = ['snap_tolerance', 'snap_x_tolerance', 'snap_y...
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
Set = typing.Set
A generic version of set.
TABLE_STRATEGIES = ['lines', 'lines_strict', 'text', 'explicit']
TYPE_CHECKING = False
T_bbox = typing.Tuple[typing.Union[int, float], typing.Un...ping.Union...
T_intersections = typing.Dict[typing.Tuple[typing.Union[int, float...[...
T_num = typing.Union[int, float]
T_obj = typing.Dict[str, typing.Any]
T_obj_iter = typing.Iterable[typing.Dict[str, typing.Any]]
T_obj_list = typing.List[typing.Dict[str, typing.Any]]
T_point = typing.Tuple[typing.Union[int, float], typing.Union[int, flo...
T_table_settings = typing.Union[ForwardRef('TableSettings'), typing.Di...
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Type = typing.Type
Deprecated alias to builtins.type.
builtins.type or typing.Type can be used to annotate class objects.
For example, suppose we have the following classes::
class User: ... # Abstract base for User classes
class BasicUser(User): ...
class ProUser(User): ...
class TeamUser(User): ...
And a function that takes a class argument that's a subclass of
User and returns an instance of the corresponding class::
def new_user[U](user_class: Type[U]) -> U:
user = user_class()
# (Here we could write the user object to a database)
return user
joe = new_user(BasicUser)
At this point the type checker knows that joe has type BasicUser.
UNSET = 0.0
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfplumber\table.py
pdfplumber.utils
Python Library Documentation: package pdfplumber.utils in pdfplumber
NAME
pdfplumber.utils
PACKAGE CONTENTS
clustering
exceptions
generic
geometry
pdfinternals
text
DATA
DEFAULT_X_DENSITY = 7.25
DEFAULT_X_TOLERANCE = 3
DEFAULT_Y_DENSITY = 13
DEFAULT_Y_TOLERANCE = 3
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pdfplumber\utils\__init__.py