Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 2.0.2 instead.
Reason given by maintainers: Incorrectly sets User-Agent to: zamar-python-v1. See: https://github.com/zamzar/zamzar-python/pull/42

Python file converter library for Zamzar

@zamzar on Twitter pypi version GitHub License

Easy to use Python file conversion API with support for 2.0.0+ file conversions - convert documents, audio, images, video, eBooks and more. Use zamzar-python to convert files between different formats as part of your Python application with the Zamzar file conversion API. Common use cases include:

  • Convert Microsoft Word (DOCX, DOC) to PDF
  • Convert Powerpoint (PPT, PPTX) to JPG
  • Extract text from PDF files
  • Archive email (MSG files) to PDF

This is the official Python SDK for the Zamzar API.

Jump to:

Requirements

Installation

You can install the Zamzar Python SDK using pip:

pip install --upgrade zamzar

Usage

Getting Started

Please follow the installation instructions and execute the following Python code:

from zamzar import ZamzarClient

zamzar = ZamzarClient("YOUR_API_KEY_GOES_HERE")

zamzar.convert("/tmp/example.docx", "pdf").store("/tmp/").delete_all_files()

See the examples to learn more about how to use the Zamzar Python SDK.

Using the sandbox environment

Whilst developing your application, you can use the lZamzar sandbox environment to test your code without consuming production credits:

from zamzar import ZamzarClient, Environment

zamzar = ZamzarClient("YOUR_API_KEY_GOES_HERE", environment=Environment.SANDBOX)

The Zamzar Python SDK uses the production environment by default, but you can also specify it explicitly:

from zamzar import ZamzarClient, Environment

zamzar = ZamzarClient("YOUR_API_KEY_GOES_HERE", environment=Environment.PRODUCTION)

Logging

By default, the Zamzar Python SDK does not log HTTP requests and responses. To enable logging, configure a logging.Logger for urllib3:

import logging

from zamzar import ZamzarClient

# Configure logging as needed. Here we configure a simple console logger
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.DEBUG)  # Set the logging level for the console handler
console_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
console_handler.setFormatter(console_formatter)
root_logger = logging.getLogger()
root_logger.addHandler(console_handler)
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')

# Enable logging for urllib3 to see HTTP requests
urllib3_logger = logging.getLogger('urllib3')
urllib3_logger.setLevel(logging.DEBUG)

# Make a request to the Zamzar API
zamzar = ZamzarClient("YOUR_API_KEY_GOES_HERE")
zamzar.account.get()

Configuring timeouts and retries

The Zamzar Python SDK will automatically:

  • time out long-running requests
  • retry requests that fail or time out

The default settings are defined in ZamzarClient.

To override these defaults, configure your own urllib3.Retry and pass it to the ZamzarClient constructor:

import urllib3

from zamzar import ZamzarClient

# Configure a custom retry policy
custom_policy = urllib3.Retry(
    total=5,  # Maximum number of retries
    backoff_factor=1,  # Exponential backoff factor
    backoff_max=60,  # Maximum backoff time
    status_forcelist=[429, 502, 503, 504],  # HTTP status codes to retry
    allowed_methods=None  # retry all request methods
)

# Make a request to the Zamzar API
zamzar = ZamzarClient("YOUR_API_KEY_GOES_HERE", retries=custom_policy)

Resources

Code Samples - Copy/Paste from examples which demonstrate all key areas of functionality.

Developer Docs - For more information about API operations, parameters, and responses. Use this if you need additional context on all areas of functionality.

Compatibility

This SDK requires Python 3.11 or later. Earlier SDK versions support older Python versions (see below), but those SDK releases are no longer maintained. We encourage you to upgrade to a supported Python and SDK version wherever possible.

Zamzar Python Version Compatible Python Versions
1.x 3.7 to 3.14
2.x 3.11 or later

Metadata

Release files for zamzar 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zamzar 2.0.0
File Size Uploaded Provenance Actions
zamzar-2.0.0.tar.gz 55.7 kB Without provenance Details for zamzar-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zamzar 2.0.0
File Interpreter ABI Platform Actions
zamzar-2.0.0-py3-none-any.whl Python 3 none any Details for zamzar-2.0.0-py3-none-any.whl

Total release size: 142.7 kB

Release files / zamzar-2.0.0.tar.gz

Download URL zamzar-2.0.0.tar.gz
Size 55.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0d06cf31d787d427d0a2fedc6926034008301444c0c946fd0e45f3434675595a
BLAKE2b-256 checksum
How to use checksums
fa95b32e3395951ad5d760f7bb351487f1a964b7b753a2c10d404e6ee2d95d93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / zamzar-2.0.0-py3-none-any.whl

Download URL zamzar-2.0.0-py3-none-any.whl
Size 87.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36c090b3eb7ec1003bed0f76cd3b810bba4fcef9e9bd6c3d3d85fa59d7502d1b
BLAKE2b-256 checksum
How to use checksums
bc86d481842a1936f80eda1d085dbe393c589a44b6dd4a3bc871ff1a0b024b11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for zamzar 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page