pypdf の API リファレンス
pypdf (py-pdf/pypdf) の公開 API 156 件 —— クラス 55、関数 40、メソッド 61。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。
リポジトリ: py-pdf/pypdf
| 種別 | 件数 |
|---|---|
| クラス | 55 |
| 関数 | 40 |
| メソッド | 61 |
API 一覧
class
make_release.ChangeCapture the data of a git commit.
func
make_release.adjust_version_py(version:str) -> NoneAdjust the __version__ string.
func
make_release.get_author_mapping(line_count:int) -> dict[str, str]Get the authors for each commit.
func
make_release.get_changelog(changelog_path:str) -> strRead the changelog.
func
make_release.get_formatted_changes(git_tag:str) -> tuple[str, str]Format the changes done since the last tag.
func
make_release.get_git_commits_since_tag(git_tag:str) -> list[Change]Get all commits since the last tag.
func
make_release.get_most_recent_git_tag() -> strGet the git tag most recently created.
func
make_release.get_version_interactive(new_version:str, changes:str) -> strGet the new __version__ interactively.
func
make_release.is_semantic_version(version:str) -> boolCheck if the given version is a semantic version.
func
make_release.main(changelog_path:str) -> NoneCreate a changelog.
func
make_release.parse_commit_line(line:str, authors:dict[str, str]) -> ChangeParse the first line of a git commit message.
func
make_release.print_instructions(new_version:str) -> NonePrint release instructions.
func
make_release.strip_header(md:str) -> strRemove the 'CHANGELOG' header.
func
make_release.version_bump(git_tag:str) -> strIncrease the patch version of the git tag by one.
func
make_release.write_changelog(new_changelog:str, changelog_path:str) -> NoneWrite the changelog.
func
make_release.write_commit_msg_file(new_version:str, commit_changes:str) -> NoneWrite a file that can be used as a commit message.
func
make_release.write_release_msg_file(new_version:str, commit_changes:str, today:datetime) -> NoneWrite a file that can be used as a git tag message.
class
pypdf._codecs._codecs.CodecAbstract base class for all codecs.
method
pypdf._codecs._codecs.Codec.decode(data:bytes) -> bytesDecode the input data.
method
pypdf._codecs._codecs.Codec.encode(data:bytes) -> bytesEncode the input data.
class
pypdf._codecs._codecs.LzwCodecLempel-Ziv-Welch (LZW) adaptive compression codec.
method
pypdf._codecs._codecs.LzwCodec.encode(data:bytes) -> bytesEncode data using the LZW compression algorithm.
class
pypdf._doc_common.PdfDocCommonCommon functions from PdfWriter and PdfReader objects.
method
pypdf._doc_common.PdfDocCommon.attachment_list() -> Generator[EmbeddedFile, None, None]Iterable of attachment objects.
method
pypdf._doc_common.PdfDocCommon.attachments() -> Mapping[str, list[bytes]]Mapping of attachment filenames to their content.
method
pypdf._doc_common.PdfDocCommon.decode_permissions(permissions_code:int) -> NoReturnTake the permissions as an integer, return the allowed access.
method
pypdf._doc_common.PdfDocCommon.get_destination_page_number(destination:Destination) -> Optional[int]Retrieve page number of a given Destination object.
method
pypdf._doc_common.PdfDocCommon.get_form_text_fields(full_qualified_name:bool=False) -> dict[str, Any]Retrieve form fields from the document with textual data.
method
pypdf._doc_common.PdfDocCommon.get_num_pages() -> intCalculate the number of pages in this PDF file.
method
pypdf._doc_common.PdfDocCommon.get_page(page_number:int) -> PageObjectRetrieve a page by number from this PDF file.
method
pypdf._doc_common.PdfDocCommon.get_page_number(page:PageObject) -> Optional[int]Retrieve page number of a given PageObject.
method
pypdf._doc_common.PdfDocCommon.get_pages_showing_field(field:Union[Field, PdfObject, IndirectObject]) -> list[PageObject]Provides list of pages where the field is called.
method
pypdf._doc_common.PdfDocCommon.page_labels() -> list[str]A list of labels for the pages in this document.
method
pypdf._doc_common.PdfDocCommon.page_layout() -> Optional[str]Get the page layout currently being used.
method
pypdf._doc_common.PdfDocCommon.page_mode() -> Optional[PagemodeType]Get the page mode currently being used.
method
pypdf._doc_common.PdfDocCommon.remove_page(page:Union[int, PageObject, IndirectObject], clean:bool=False) -> NoneRemove page from pages list.
method
pypdf._doc_common.PdfDocCommon.threads() -> Optional[ArrayObject]Read-only property for the list of threads.
method
pypdf._font.Font.can_encode(text:str) -> boolCheck whether the font is able to encode a text string.
method
pypdf._font.Font.get_text_width(text:str='') -> floatSum of character widths specified in PDF font for the supplied text.
class
pypdf._page.ImageFileImage within the PDF file.
method
pypdf._page.ImageFile.replace(new_image:Image, **kwargs:Any) -> NoneReplace the image with a new PIL image.
class
pypdf._page.PageObjectPageObject represents a single page within a PDF file.
method
pypdf._page.PageObject.add_transformation(ctm:Union[Transformation, CompressedTransformationMatrix], expand:bool=False) -> NoneApply a transformation matrix to the page.
method
pypdf._page.PageObject.create_blank_page(pdf:Optional[PdfCommonDocProtocol]=None, width:Union[float, Decimal, None]=None, height:Union[float, Decimal, None]=None) -> 'PageObject'Return a new blank page.
method
pypdf._page.PageObject.get_contents() -> Optional[ContentStream]Access the page contents.
method
pypdf._page.PageObject.hash_bin() -> intUsed to detect modified object.
method
pypdf._page.PageObject.images() -> VirtualListImagesRead-only property emulating a list of images on a page.
method
pypdf._page.PageObject.inline_images() -> Optional[dict[str, ImageFile]]Return only inline images from the page.
method
pypdf._page.PageObject.merge_page(page2:'PageObject', expand:bool=False, over:bool=True) -> NoneMerge the content streams of two pages into one.
method
pypdf._page.PageObject.rotate(angle:int) -> 'PageObject'Rotate a page clockwise by increments of 90 degrees.
method
pypdf._page.PageObject.rotation() -> intThe visual rotation of the page.
class
pypdf._page.TransformationRepresent a 2D transformation.
method
pypdf._page.Transformation.rotate(rotation:float) -> 'Transformation'Rotate the contents of a page.
method
pypdf._page.Transformation.transform(m:'Transformation') -> 'Transformation'Apply one transformation to another.
method
pypdf._page.Transformation.translate(tx:float=0, ty:float=0) -> 'Transformation'Translate the contents of a page.
class
pypdf._page.VirtualListImagesProvides access to images referenced within a page.
func
pypdf._page_labels.index2label(reader:PdfCommonDocProtocol, index:int) -> strSee 7.9.7 "Number Trees".
func
pypdf._page_labels.nums_clear_range(key:NumberObject, page_index_to:int, nums:ArrayObject) -> NoneRemove all entries in a number tree in a range after an entry.
func
pypdf._page_labels.nums_insert(key:NumberObject, value:DictionaryObject, nums:ArrayObject) -> NoneInsert a key, value pair in a Nums array.
class
pypdf._reader.PdfReaderInitialize a PdfReader object.
method
pypdf._reader.PdfReader.add_form_topname(name:str) -> Optional[DictionaryObject]Add a top level form that groups all form fields below it.
method
pypdf._reader.PdfReader.close() -> NoneClose the stream if opened in __init__ and clear memory.
method
pypdf._reader.PdfReader.pdf_header() -> strThe first 8 bytes of the file.
method
pypdf._reader.PdfReader.read(stream:StreamType) -> NoneRead and process the PDF stream, extracting necessary data.
method
pypdf._reader.PdfReader.rename_form_topname(name:str) -> Optional[DictionaryObject]Rename top level form field that all form fields below it.
method
pypdf._reader.PdfReader.root_object() -> DictionaryObjectProvide access to "/Root".
method
pypdf._reader.PdfReader.xmp_metadata() -> Optional[XmpInformation]XMP (Extensible Metadata Platform) data.
func
pypdf._text_extraction._layout_mode._fixed_width_page.resolve_font(fonts:dict[str, Font], name:str) -> FontResolve a Tf font name to a layout mode Font.
class
pypdf._text_extraction._text_extractor.TextExtractionA class to handle PDF text extraction operations.
func
pypdf._utils.check_if_whitespace_only(value:bytes) -> boolCheck if the given value consists of whitespace characters only.
func
pypdf._utils.deprecate_no_replacement(name:str, removed_in:str) -> NoneIssue a warning that a feature will be removed without replacement.
func
pypdf._utils.format_iso8824_date(dt:datetime) -> strConvert a datetime object to PDF date string format.
func
pypdf._utils.is_char_neutral(char:str, custom_special_characters:str='') -> boolCheck if a character is part of neutral character ranges
func
pypdf._utils.is_char_rtl(char:str, custom_rtl_min:str='', custom_rtl_max:str='') -> boolCheck if a character is part of RTL character ranges
func
pypdf._utils.logger_error(message:str, *source:str, **values:Any) -> NoneUse this instead of logger.error directly.
func
pypdf._utils.logger_warning(message:str, *source:str, **values:Any) -> NoneUse this instead of logger.warning directly.
func
pypdf._utils.mark_location(stream:StreamType) -> NoneCreate text file showing current location in context.
func
pypdf._utils.read_non_whitespace(stream:BinaryStreamType) -> bytesFind and read the next non-whitespace character (ignores whitespace).
func
pypdf._utils.read_previous_line(stream:StreamType) -> bytesGiven a byte stream with current position X, return the previous line.
func
pypdf._utils.read_until_whitespace(stream:StreamType, max_bytes:Optional[int]=None) -> bytesRead non-whitespace characters and return them.
func
pypdf._utils.rename_kwargs(func_name:str, kwargs:dict[str, Any], aliases:dict[str, str], fail:bool=False) -> NoneHelper function to deprecate arguments.
class
pypdf.annotations._markup_annotations.FreeTextA FreeText annotation
class
pypdf.annotations._markup_annotations.MarkupAnnotationBase class for all markup annotations.
class
pypdf.annotations._markup_annotations.TextA text annotation.
class
pypdf.constants.AnnotationDictionaryAttributesTable 8.15 Entries common to all annotation dictionaries.
class
pypdf.constants.AnnotationFlagSee §12.5.3 "Annotation Flags".
class
pypdf.constants.BorderStylesA class defining border styles used in PDF documents.
class
pypdf.constants.CatalogDictionary§7.7.2 of the 1.7 and 2.0 references.
class
pypdf.constants.CcittFaxDecodeParametersTable 4.5.
class
pypdf.constants.CheckboxRadioButtonAttributesTable 8.76 Field flags common to all field types.
class
pypdf.constants.CoreKeywords that don't quite belong anywhere else.
class
pypdf.constants.DocumentInformationAttributesTable 10.2 Entries in the document information dictionary.
class
pypdf.constants.FieldFlagTable 8.70 Field flags common to all field types.
class
pypdf.constants.FileSpecificationDictionaryEntriesTable 3.41 Entries in a file specification dictionary.
class
pypdf.constants.FilterTypeAbbreviations§8.9.7 of the 1.7 and 2.0 references.
class
pypdf.constants.FilterTypes§7.4 of the 1.7 and 2.0 references.
class
pypdf.constants.GraphicsStateParametersTable 58 – Entries in a Graphics State Parameter Dictionary
class
pypdf.constants.ImageAttributes§11.6.5 of the 1.7 and 2.0 references.
class
pypdf.constants.LzwFilterParametersTable 4.4.
class
pypdf.constants.OutlineFontFlagA class used as an enumerable flag for formatting an outline font.
class
pypdf.constants.PageAttributes§7.7.3.3 of the 1.7 and 2.0 reference.
class
pypdf.constants.PageLabelStyleTable 8.10 in the 1.7 reference.
class
pypdf.constants.PageLayoutsPage 84, PDF 1.4 reference.
class
pypdf.constants.PagesAttributes§7.7.3.2 of the 1.7 and 2.0 reference.
class
pypdf.constants.ResourcesTable 3.30 Entries in a resource dictionary.
class
pypdf.constants.StreamAttributesTable 4.2.
class
pypdf.constants.TypArgumentsTable 8.2 of the PDF 1.7 reference.
class
pypdf.constants.TypFitArgumentsTable 8.2 of the PDF 1.7 reference.
class
pypdf.constants.UserAccessPermissionsTable 3.20 User access permissions.
class
pypdf.errors.DeprecationErrorRaised when a deprecated feature is used.
class
pypdf.errors.EmptyFileErrorRaised when a PDF file is empty or has no content.
class
pypdf.errors.EmptyImageDataErrorRaised when trying to process an image that has no data.
class
pypdf.errors.LimitReachedErrorRaised when a limit is reached.
class
pypdf.errors.PageSizeNotDefinedErrorRaised when the page size of a PDF document is not defined.
class
pypdf.errors.PdfReadErrorRaised when there is an issue reading a PDF file.
class
pypdf.errors.PyPdfErrorBase class for all exceptions raised by pypdf.
class
pypdf.errors.XmpDocumentErrorRaised when the XMP XML document context is invalid or missing.
class
pypdf.filters.ASCII85DecodeDecodes string ASCII85-encoded data into a byte format.
method
pypdf.filters.ASCII85Decode.decode(data:Union[str, bytes], decode_parms:Optional[DictionaryObject]=None, **kwargs:Any) -> bytesDecode an Ascii85 encoded data stream.
class
pypdf.filters.CCITTFaxDecode§7.4.6, CCITTFaxDecode filter (ISO 32000).
class
pypdf.filters.CCITTParameters§7.4.6, optional parameters for the CCITTFaxDecode filter.
func
pypdf.filters.decode_stream_data(stream:StreamObject) -> bytesDecode the stream data based on the specified filters.
func
pypdf.filters.decompress(data:bytes) -> bytesDecompress the given data using zlib.
method
pypdf.generic._base.PdfObject.get_object() -> Optional['PdfObject']Resolve indirect references.
method
pypdf.generic._base.PdfObject.hash_bin() -> intUsed to detect modified object.
class
pypdf.generic._base.TextStringObjectA string object that has been decoded into a real unicode string.
method
pypdf.generic._base.TextStringObject.clone(pdf_dest:Any, force_duplicate:bool=False, ignore_fields:Optional[Sequence[Union[str, int]]]=()) -> 'TextStringObject'Clone object into pdf_dest.
method
pypdf.generic._base.TextStringObject.hash_bin() -> intUsed to detect modified object.
func
pypdf.generic._base.is_null_or_none(x:Any) -> TypeGuard[Union[NullObject, IndirectObject, None]]Returns: True if x is None or NullObject.
class
pypdf.generic._data_structures.DestinationA class representing a destination within a PDF file.
method
pypdf.generic._data_structures.Destination.font_format() -> Optional[OutlineFontFlag]Read-only property accessing the font type.
method
pypdf.generic._data_structures.Destination.outline_count() -> Optional[int]Read-only property accessing the outline count.
method
pypdf.generic._data_structures.Destination.title() -> Optional[str]Read-only property accessing the destination title.
method
pypdf.generic._data_structures.Destination.typ() -> Optional[str]Read-only property accessing the destination type.
method
pypdf.generic._data_structures.Destination.zoom() -> Optional[int]Read-only property accessing the zoom factor.
class
pypdf.generic._data_structures.FieldA class representing a field dictionary.
method
pypdf.generic._data_structures.Field.kids() -> Optional['ArrayObject']Read-only property accessing the kids of this field.
method
pypdf.generic._data_structures.Field.name() -> Optional[str]Read-only property accessing the name of this field.
method
pypdf.generic._data_structures.Field.value() -> Optional[Any]Read-only property accessing the value of this field.
class
pypdf.generic._files.EmbeddedFileContainer holding the information on an embedded file.
method
pypdf.generic._files.EmbeddedFile.checksum() -> bytes | NoneRetrieve the MD5 checksum of the (uncompressed) file.
method
pypdf.generic._files.EmbeddedFile.content() -> bytesRetrieve the actual file content.
method
pypdf.generic._files.EmbeddedFile.creation_date() -> datetime.datetime | NoneRetrieve the file creation datetime.
method
pypdf.generic._files.EmbeddedFile.delete() -> NoneDelete the file from the document.
method
pypdf.generic._files.EmbeddedFile.description() -> str | NoneRetrieve the description.
method
pypdf.generic._files.EmbeddedFile.size() -> int | NoneRetrieve the size of the uncompressed file in bytes.
method
pypdf.generic._files.EmbeddedFile.subtype() -> str | NoneRetrieve the subtype.
func
pypdf.generic._image_inline.extract_inline__ascii85_decode(stream:StreamType) -> bytesExtract A85 stream from inline image.
func
pypdf.generic._image_inline.extract_inline__ascii_hex_decode(stream:StreamType) -> bytesExtract HexEncoded stream from inline image.
func
pypdf.generic._image_inline.extract_inline__dct_decode(stream:BinaryStreamType) -> bytesExtract DCT (JPEG) stream from inline image.
func
pypdf.generic._image_inline.extract_inline__run_length_decode(stream:StreamType) -> bytesExtract RL (RunLengthDecode) stream from inline image.
func
pypdf.generic._image_inline.extract_inline_default(stream:StreamType) -> bytesLegacy method, used by default
class
pypdf.generic._rectangle.RectangleObjectThis class is used to represent *page boxes* in pypdf.
class
pypdf.pagerange.PageRangeA slice-like representation of a range of page indices.
method
pypdf.pagerange.PageRange.to_slice() -> sliceReturn the slice equivalent of this page range.
method
pypdf.pagerange.PageRange.valid(input:Any) -> boolTrue if input is a valid initializer for a PageRange.
この情報について
掲載しているシグネチャは py-pdf/pypdf の公開ソースコードを
Python の ast モジュールで静的解析し、引数名・デフォルト値・
型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。
詳しくは仕組みの解説をご覧ください。