https://github.com/nemuelw/pyzamzar
Python SDK for the Zamzar file conversion API
https://github.com/nemuelw/pyzamzar
api-client api-client-python api-wrapper file-conversion pypi-package python3 sdk sdk-python zamzar zamzar-api
Last synced: 10 months ago
JSON representation
Python SDK for the Zamzar file conversion API
- Host: GitHub
- URL: https://github.com/nemuelw/pyzamzar
- Owner: nemuelw
- Created: 2024-03-15T18:17:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T09:02:16.000Z (about 2 years ago)
- Last Synced: 2024-08-05T21:34:12.887Z (almost 2 years ago)
- Topics: api-client, api-client-python, api-wrapper, file-conversion, pypi-package, python3, sdk, sdk-python, zamzar, zamzar-api
- Language: Python
- Homepage: https://pypi.org/project/pyzamzar
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pyzamzar
Python SDK for the Zamzar file conversion API
## Installation
```bash
pip install pyzamzar
```
## Usage
### Obtain your API key
[Create an account](https://developers.zamzar.com/pricing), [log in](https://developers.zamzar.com/login) and obtain your API key [here](https://developers.zamzar.com/user)
### Initialize Zamzar client
```python
from zamzar import ZamzarClient
client = ZamzarClient('YOUR_API_KEY')
```
### Start conversion job
Example:
```python
job_info = client.start_conversion_job('README.md', 'pdf')
job_id = job_info['id']
```
### Poll job status until its completion
Example:
```python
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:
```python
file_id = job_status['target_files'][0]['id']
client.download_converted_file(file_id, 'readme.pdf')
print("File downloaded successfully as 'readme.pdf'.")
```