PDF Remote Converter

Converts MS Office documents (Word, Excel, Powerpoint) to PDF via API providers/remote access. Supported providers offer a generous free tier.
Supported Providers
| Provider |
Free Tier |
Formats |
Notes |
| CloudConvert |
10 conversions/day |
doc, docx, xls, xlsx, ppt, pptx |
Default provider, async polling |
| Adobe PDF Services |
500 transactions/month |
doc, docx, xls, xlsx, ppt, pptx |
Requires client ID + secret |
| ApyHub |
5 conversions/day |
doc, docx, xls, xlsx, ppt, pptx |
Synchronous API, fast response |
| Google Drive |
Unlimited |
doc, docx, xls, xlsx, ppt, pptx |
Requires service account JSON |
| Zamzar |
100 credits/month |
doc, docx, xls, xlsx, ppt, pptx |
1MB file size limit |
Features
- Multiple Cloud Providers: Support for 5 different conversion backends with automatic failover
- HTTP Caching: Hishel-backed RFC 9111 caching for provider downloads (
--force to bypass)
- CLI and Library: Use as a command-line tool or Python library
- Automatic Failover: Seamless fallback when providers are unavailable or quota exhausted
- Modern Python: Built with Python 3.13+, strict type checking, and 100% test coverage
- Easy Configuration: Environment variable-based setup with fallback API key support
Documentation
For detailed documentation, see:
- Installation Guide
- Quickstart
- CLI Reference
- Configuration
- Supported Providers
- Google Drive Setup
- Troubleshooting
- Developer Guide
- API Reference
Installation
# Install from PyPI (recommended)
uv tool install pdf-remote-converter
# or: pip install pdf-remote-converter
To work on the project itself:
# Clone the repository
git clone https://github.com/jr2804/pdf-remote-converter.git
cd pdf-remote-converter
# Install dependencies
uv sync --dev
Usage
CLI: Convert Office Documents to PDF
# Basic conversion (uses default configured provider)
pdf-remote-converter convert input.docx output.pdf
# Specify a provider explicitly
pdf-remote-converter convert --provider cloudconvert input.xlsx output.pdf
pdf-remote-converter convert --provider adobe input.pptx output.pdf
pdf-remote-converter convert --provider apyhub input.xlsx output.pdf
pdf-remote-converter convert --provider google_drive input.docx output.pdf
# Provide API key via command line
pdf-remote-converter convert --api-key YOUR_KEY --provider zamzar input.docx output.pdf
# Force fresh conversion (bypass HTTP cache)
pdf-remote-converter convert --force input.docx output.pdf
# Enable verbose logging for debugging
pdf-remote-converter convert --verbose input.docx output.pdf
# Show help and available options
pdf-remote-converter convert --help
Configuration
All configuration is via environment variables. Set up your credentials:
# CloudConvert (10 conversions/day free tier)
export CLOUDCONVERT_API_KEY=your_api_key
# Adobe PDF Services (500 transactions/month free tier)
export ADOBE_CLIENT_ID=your_client_id
export ADOBE_CLIENT_SECRET=your_client_secret
# ApyHub (5 conversions/day free tier, synchronous API)
export APYHUB_API_KEY=your_api_token
# Google Drive (unlimited, requires service account)
export GOOGLE_DRIVE_CREDENTIALS=path/to/service_account.json
# Zamzar (100 credits/month free tier, 1MB max)
export ZAMZAR_API_KEY=your_api_key
# Optional: Generic fallback API key (used if provider-specific key not set)
export PDF_REMOTE_CONVERTER_API_KEY=your_fallback_key
# Optional: Default provider (default is cloudconvert)
export PDF_REMOTE_CONVERTER_DEFAULT_PROVIDER=cloudconvert
# Optional: Adaptive timeout range (seconds)
export PDF_REMOTE_CONVERTER_POLL_TIMEOUT_MIN=60
export PDF_REMOTE_CONVERTER_POLL_TIMEOUT_MAX=600
# Optional: Cache directory (default is ~/.cache/pdf-remote-converter)
export PDF_REMOTE_CONVERTER_CACHE_DIR=~/.cache/pdf-remote-converter
Copy .env.example to .env and fill in your credentials:
cp .env.example .env
# Edit .env with your API keys
Running Tests
# Run all tests with coverage (100% coverage is enforced)
uv run pytest tests/ -v --cov=pdf_remote_converter --cov-report=term-missing
Code Quality
The project uses mise for task orchestration:
mise install # install the pinned tool versions
mise dev # uv sync -U --dev --all-extras --all-groups
mise lint # ruff check --fix
mise spell # codespell
mise typecheck # ty (static type check)
mise format # ruff format + ruff isort + pyreorder
mise format-md # rumdl over Markdown
mise test # pytest with coverage
mise all # everything: test, lint, spell, format, format-md, docs
Programmatic Usage (Python Library)
from pdf_remote_converter import Converter
# Create converter with default settings
converter = Converter()
# Convert document
result = converter.convert("input.docx", "output.pdf")
# Check result
print(f"Converted by: {result.provider}")
print(f"From cache: {result.from_cache}")
print(f"Credits used: {result.credits_used}")
# Use specific provider
converter = Converter(provider="adobe")
result = converter.convert("input.xlsx", "output.pdf")
# Provide API key programmatically
converter = Converter(provider="cloudconvert", api_key="your_key")
result = converter.convert("input.pptx", "output.pdf")
Development
Setting Up Development Environment
# Install all dependencies including dev tools
uv sync --dev
Pre-commit Hooks
Install pre-commit hooks to run quality checks before commits:
pre-commit install
pre-commit run --all-files
Releasing
Push to main and the release workflow computes the CalVer tag, builds the
package, creates a GitHub release, publishes to PyPI, and mirrors the branch
and tags to the 3GPP Forge. Append [skip release] to the commit message to
skip a release.
Building Documentation
uv run zensical build
Project Structure
pdf-remote-converter/
├── docs/ # Zensical documentation
├── src/pdf_remote_converter/
│ ├── __init__.py
│ ├── __about__.py # Version info
│ └── cli/ # Cyclopts CLI module
├── tests/ # Pytest tests
├── .pre-commit-config.yaml # Pre-commit hooks configuration
├── ruff.toml # Ruff linter configuration
├── ty.toml # ty type checker configuration
└── pyproject.toml # Project configuration
Versioning
This project uses Calendar Versioning (YYYY.MM.DD). The version lives in
pyproject.toml and the release tag is v<YYYY.MM.DD>.
- Releases are cut automatically from
main by the GitHub Actions release workflow
- Publishing to PyPI uses trusted publishing (OIDC), so no API token is stored
- The 3GPP Forge repository is kept as a read-only mirror of the GitHub repository
License
This project is licensed under the MIT license.
See the LICENSE file for details.
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Run quality checks:
uv run ruff check src/ tests/ && uv run ruff format src/ tests/ && uv run pytest tests/ -v --cov=pdf_remote_converter --cov-report=term-missing
- Submit a pull request
Support
For issues and feature requests, please use the GitHub issue tracker.