Skip to main content

Python SDK for the Zamzar file conversion API

Project description

pyzamzar

Python SDK for the Zamzar file conversion API

Installation

pip install pyzamzar

Usage

Obtain your API key

Create an account, log in and obtain your API key here

Initialize Zamzar client

from zamzar import ZamzarClient

client = ZamzarClient('YOUR_API_KEY')

Start conversion job

Example:

job_info = client.start_conversion_job('README.md', 'pdf')
job_id = job_info['id']

Poll job status until its completion

Example:

while True:
    job_status = client.get_job_status(job_id)
    if job_status['status'] == 'successful':
        break
    elif job_status['status'] == 'failed':
        print("Conversion failed.")
        return
    else:
        print("Conversion in progress. Please wait...")

Download converted file(s)

Example:

file_id = job_status['target_files'][0]['id']
client.download_converted_file(file_id, 'readme.pdf')
print("File downloaded successfully as 'readme.pdf'.")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyzamzar-1.0.4.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

pyzamzar-1.0.4-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page