From 109ef4aaeaaf4e4c3ccff341c71102d3c1946b02 Mon Sep 17 00:00:00 2001 From: j-t-1 <120829237+j-t-1@users.noreply.github.com> Date: Wed, 22 May 2024 14:57:55 +0100 Subject: [PATCH] DOC: Tiny changes to docstrings (#2669) Tiny changes to docstrings within PdfReader, PdfWriter and PdfDocCommon --- pypdf/_doc_common.py | 5 ++--- pypdf/_reader.py | 8 ++++---- pypdf/_writer.py | 10 +++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pypdf/_doc_common.py b/pypdf/_doc_common.py index 0baab4fc7..3264d7431 100644 --- a/pypdf/_doc_common.py +++ b/pypdf/_doc_common.py @@ -793,8 +793,7 @@ def open_destination(self, dest: Union[None, str, Destination, PageObject]) -> N @property def outline(self) -> OutlineType: """ - Read-only property for the outline present in the document. - + Read-only property for the outline present in the document (i.e., a collection of 'outline items' which are also known as 'bookmarks') """ @@ -1002,7 +1001,7 @@ def pages(self) -> List[PageObject]: this property allows to get a page or a range of pages. For PdfWriter Only: - It provides also capability to remove a page/range of page from the list + Provides the capability to remove a page/range of page from the list (using the del operator) Note: only the page entry is removed. As the objects beneath can be used elsewhere. diff --git a/pypdf/_reader.py b/pypdf/_reader.py index d37635b29..3d4b672ed 100644 --- a/pypdf/_reader.py +++ b/pypdf/_reader.py @@ -155,13 +155,13 @@ def __init__( @property def root_object(self) -> DictionaryObject: - """Provide access to "/Root". standardized with PdfWriter.""" + """Provide access to "/Root". Standardized with PdfWriter.""" return cast(DictionaryObject, self.trailer[TK.ROOT].get_object()) @property def _info(self) -> Optional[DictionaryObject]: """ - Provide access to "/Info". standardized with PdfWriter. + Provide access to "/Info". Standardized with PdfWriter. Returns: /Info Dictionary; None if the entry does not exist @@ -180,7 +180,7 @@ def _info(self) -> Optional[DictionaryObject]: @property def _ID(self) -> Optional[ArrayObject]: """ - Provide access to "/ID". standardized with PdfWriter. + Provide access to "/ID". Standardized with PdfWriter. Returns: /ID array; None if the entry does not exist @@ -196,7 +196,7 @@ def _repr_mimebundle_( """ Integration into Jupyter Notebooks. - This method returns a dictionary that maps a mime-type to it's + This method returns a dictionary that maps a mime-type to its representation. See https://ipython.readthedocs.io/en/stable/config/integrating.html diff --git a/pypdf/_writer.py b/pypdf/_writer.py index 61e724bec..9587b0493 100644 --- a/pypdf/_writer.py +++ b/pypdf/_writer.py @@ -255,20 +255,20 @@ def is_encrypted(self) -> bool: @property def root_object(self) -> DictionaryObject: """ - Provide direct access to Pdf Structure. + Provide direct access to PDF Structure. Note: - Recommended be used only for read access. + Recommended only for read access. """ return self._root_object @property def _info(self) -> Optional[DictionaryObject]: """ - Provide access to "/Info". standardized with PdfWriter. + Provide access to "/Info". Standardized with PdfReader. Returns: - /Info Dictionary ; None if the entry does not exists + /Info Dictionary; None if the entry does not exist """ return cast(DictionaryObject, self._info_obj.get_object()) @@ -320,7 +320,7 @@ def _repr_mimebundle_( """ Integration into Jupyter Notebooks. - This method returns a dictionary that maps a mime-type to it's + This method returns a dictionary that maps a mime-type to its representation. See https://ipython.readthedocs.io/en/stable/config/integrating.html