Skip to content

Commit

Permalink
DOC: Tiny changes to docstrings (#2669)
Browse files Browse the repository at this point in the history
Tiny changes to docstrings within PdfReader, PdfWriter and PdfDocCommon
  • Loading branch information
j-t-1 committed May 22, 2024
1 parent f6fca0c commit 109ef4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
5 changes: 2 additions & 3 deletions pypdf/_doc_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
"""
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions pypdf/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions pypdf/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 109ef4a

Please sign in to comment.