Python SDK

The Python SDK provides a client for integrating PDFGate API endpoints into your Python applications. It is designed for automation scripts, backend services, data pipelines, and other workflows that require reliable, direct access to all API operations.

Source code: github.com/pdfgate/pdfgate-sdk-python
Package: pypi.org/project/pdfgate

Installation

Install the package with pip, then initialize the client with your API key.

Quick start

The example below generates a PDF from a URL and prints the resulting document id.

Sync and async usage

The SDK exposes both sync and async variants. Async methods use the same interface and add an _async suffix.

Download a file

Use get_file to retrieve the file bytes and save them locally.

Core methods

MethodPurpose
generate_pdfGenerate a PDF from HTML or a public URL.
get_documentRetrieve document metadata and file information.
get_fileDownload the raw PDF bytes for a stored document.
upload_fileUpload a PDF file for later transformations.
flatten_pdfFlatten form fields into a non-editable PDF.
compress_pdfCompress a PDF and return the resulting document record.
watermark_pdfApply image or text watermarks to a document.
protect_pdfEncrypt a PDF and apply access restrictions.
extract_pdf_form_dataRead field values from a fillable PDF.

Related documentation

Use the SDK together with the main API documentation for request parameters, endpoint behavior, and workflow guides such as webhooks and PDF form fields.