pdf_remote_converter
¶
pdf_remote_converter package.
Modules:
-
cli–CLI module for PDF Remote Converter.
-
config–Configuration settings for PDF Remote Converter.
-
converter–High-level converter facade for programmatic usage.
-
estimator–Estimate conversion timeout based on document complexity.
-
exceptions–Custom exception types for provider conversion errors.
-
http–HTTP client utilities with caching support.
-
logging–Logging configuration for PDF Remote Converter.
-
providers–Provider abstractions and registry helpers.
-
router–Provider routing and failover helpers.
Classes:
-
AdobeProvider–Adobe PDF Services API implementation.
-
ApyHubProvider–ApyHub file conversion API implementation.
-
CloudConvertProvider–CloudConvert API implementation.
-
ConversionResult–Represents the result of a conversion operation.
-
Converter–High-level converter API for programmatic usage.
-
GoogleDriveProvider–Google Drive file conversion via upload-export-delete flow.
-
ZamzarProvider–Zamzar API implementation.
Functions:
-
get_provider–Return the provider backend class for the given name.
AdobeProvider
¶
AdobeProvider(
client_id: str,
client_secret: str,
http_client: Client | None = None,
*,
poll_timeout: int = 120,
)
Bases: AbstractProvider
Adobe PDF Services API implementation.
Methods:
-
convert–Convert the input file to PDF.
-
is_healthy–Return True when the provider is available and configured.
Attributes:
-
max_file_size(int | None) –Return the maximum file size in bytes, or None if no limit.
Source code in src/pdf_remote_converter/providers/adobe.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
max_file_size
property
¶
max_file_size: int | None
Return the maximum file size in bytes, or None if no limit.
convert
¶
convert(
input_path: Path, output_path: Path
) -> ConversionResult
Convert the input file to PDF.
Performs format and file size validation before delegating to the provider-specific implementation via _perform_convert().
Source code in src/pdf_remote_converter/providers/base.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
is_healthy
¶
is_healthy() -> bool
Return True when the provider is available and configured.
Source code in src/pdf_remote_converter/providers/adobe.py
57 58 59 | |
ApyHubProvider
¶
Bases: AbstractProvider
ApyHub file conversion API implementation.
Supports synchronous conversion of Word (.doc, .docx), Spreadsheet (.xls, .xlsx), and Presentation (.ppt, .pptx) documents to PDF via three dedicated endpoints.
Methods:
-
convert–Convert the input file to PDF.
-
is_healthy–Return True when the provider is available and configured.
Attributes:
-
max_file_size(int | None) –Return the maximum file size in bytes, or None if no limit.
Source code in src/pdf_remote_converter/providers/apyhub.py
41 42 43 44 45 46 47 48 49 | |
max_file_size
property
¶
max_file_size: int | None
Return the maximum file size in bytes, or None if no limit.
convert
¶
convert(
input_path: Path, output_path: Path
) -> ConversionResult
Convert the input file to PDF.
Performs format and file size validation before delegating to the provider-specific implementation via _perform_convert().
Source code in src/pdf_remote_converter/providers/base.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
is_healthy
¶
is_healthy() -> bool
Return True when the provider is available and configured.
Source code in src/pdf_remote_converter/providers/apyhub.py
51 52 53 | |
CloudConvertProvider
¶
CloudConvertProvider(
api_key: str,
http_client: Client | None = None,
*,
poll_timeout: int = 120,
)
Bases: AbstractProvider
CloudConvert API implementation.
Methods:
-
convert–Convert the input file to PDF.
-
is_healthy–Return True when the provider is available and configured.
Attributes:
-
max_file_size(int | None) –Return the maximum file size in bytes, or None if no limit.
Source code in src/pdf_remote_converter/providers/cloudconvert.py
28 29 30 31 32 33 34 35 36 | |
max_file_size
property
¶
max_file_size: int | None
Return the maximum file size in bytes, or None if no limit.
convert
¶
convert(
input_path: Path, output_path: Path
) -> ConversionResult
Convert the input file to PDF.
Performs format and file size validation before delegating to the provider-specific implementation via _perform_convert().
Source code in src/pdf_remote_converter/providers/base.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
is_healthy
¶
is_healthy() -> bool
Return True when the provider is available and configured.
Source code in src/pdf_remote_converter/providers/cloudconvert.py
38 39 40 | |
ConversionResult
dataclass
¶
Represents the result of a conversion operation.
Converter
¶
Converter(
provider: str | None = None,
api_key: str | None = None,
settings: ProviderSettings | None = None,
)
High-level converter API for programmatic usage.
Methods:
-
convert–Convert an input document to PDF.
Source code in src/pdf_remote_converter/converter.py
19 20 21 22 23 24 25 26 27 28 | |
convert
¶
convert(
input_path: str | Path, output_path: str | Path
) -> ConversionResult
Convert an input document to PDF.
Source code in src/pdf_remote_converter/converter.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
GoogleDriveProvider
¶
GoogleDriveProvider(
credentials_path: Path,
http_client: Client | None = None,
*,
poll_timeout: int = 120,
)
Bases: AbstractProvider
Google Drive file conversion via upload-export-delete flow.
Uploads an Office file to Google Drive, exports it as PDF using Google Docs/Sheets/Slides conversion, then deletes the temporary file. Authentication uses a Google Cloud Service Account (JSON key file).
Parameters:
-
(credentials_path¶Path) –Path to the service account JSON key file.
-
(http_client¶Client | None, default:None) –Optional cached HTTP client (created if not provided).
-
(poll_timeout¶int, default:120) –Timeout in seconds for API requests.
Methods:
-
convert–Convert the input file to PDF.
-
is_healthy–Return True when credentials are loaded and valid.
Attributes:
-
max_file_size(int | None) –Return the maximum file size in bytes, or None if no limit.
Source code in src/pdf_remote_converter/providers/google_drive.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
max_file_size
property
¶
max_file_size: int | None
Return the maximum file size in bytes, or None if no limit.
convert
¶
convert(
input_path: Path, output_path: Path
) -> ConversionResult
Convert the input file to PDF.
Performs format and file size validation before delegating to the provider-specific implementation via _perform_convert().
Source code in src/pdf_remote_converter/providers/base.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
ZamzarProvider
¶
Bases: AbstractProvider
Zamzar API implementation.
Methods:
-
convert–Convert the input file to PDF.
-
is_healthy–Return True when the provider is available and configured.
Attributes:
-
max_file_size(int | None) –Return the maximum file size in bytes (1MB for Zamzar free tier).
Source code in src/pdf_remote_converter/providers/zamzar.py
30 31 32 33 34 35 36 37 38 | |
max_file_size
property
¶
max_file_size: int | None
Return the maximum file size in bytes (1MB for Zamzar free tier).
convert
¶
convert(
input_path: Path, output_path: Path
) -> ConversionResult
Convert the input file to PDF.
Performs format and file size validation before delegating to the provider-specific implementation via _perform_convert().
Source code in src/pdf_remote_converter/providers/base.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
is_healthy
¶
is_healthy() -> bool
Return True when the provider is available and configured.
Source code in src/pdf_remote_converter/providers/zamzar.py
45 46 47 | |
get_provider
¶
Return the provider backend class for the given name.
Source code in src/pdf_remote_converter/providers/__init__.py
14 15 16 17 18 19 20 21 22 23 24 25 26 | |