Skip to main content

GroupDocs.Conversion Cloud Python SDK

Project description

GroupDocs.Conversion Cloud Python SDK

This repository contains GroupDocs.Conversion Cloud SDK for Python source code. This SDK has been developed to help you get started with using our document conversion REST API, allowing to seamlessly convert your documents to any format you need. With this single API, you can convert back and forth between over 50 types of documents and images, including all Microsoft Office and OpenDocument file formats, PDF documents, HTML, CAD, raster images and many more.

Requirements

Python 2.7 or 3.4+

Installation

Install groupdocs-conversion-cloud with PIP from PyPI by:

pip install groupdocs-conversion-cloud

Or clone repository and install it via Setuptools:

python setup.py install

Create an account

Creating an account is very simple. Go to Dashboard to create a free account. We’re using Single Sign On across our websites, therefore, if you already have an account with our services, you can use it to also access the Dashboard.

Create an API client app

Before you can make any requests to GroupDocs Cloud API you need to get a Client Id and a Client Secret. This will be used to invoke GroupDocs Cloud API. You can get it by creating a new Application.

Convert document

Please follow the installation procedure and then run following:

# Import module
import groupdocs_conversion_cloud

# Get your clientId and clientSecret at https://dashboard.groupdocs.cloud (free registration is required).
client_id = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
client_secret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

# Create instance of the API
apiInstance = groupdocs_conversion_cloud.ConvertApi.from_keys(client_id, client_secret)

# Prepare request
request = groupdocs_conversion_cloud.ConvertDocumentDirectRequest("pdf", "myFile.docx")

# Convert
result = apiInstance.convert_document_direct(request)

print("Document converted: " + result)

Convert document using cloud storage

# Import module
import groupdocs_conversion_cloud

# Get your clientId and clientSecret at https://dashboard.groupdocs.cloud (free registration is required).
client_id = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
client_secret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

# Create instances of the APIs
fileApi = groupdocs_conversion_cloud.FileApi.from_keys(client_id, client_secret)
convertApi = groupdocs_conversion_cloud.ConvertApi.from_keys(client_id, client_secret)

# Upload file
fileApi.upload_file(groupdocs_conversion_cloud.UploadFileRequest("myFile.docx", "myFile.docx"))

# Prepare convert settings
settings = groupdocs_conversion_cloud.ConvertSettings()
settings.file_path = "myFile.docx"
settings.format = "pdf"
settings.output_path = "converted"

# Convert
result = convertApi.convert_document(groupdocs_conversion_cloud.ConvertDocumentRequest(settings))

print("Document converted: " + result)

# Download result
response = fileApi.download_file(groupdocs_conversion_cloud.DownloadFileRequest("converted/myFile.pdf", None))

Licensing

GroupDocs.Conversion Cloud Python SDK licensed under MIT License.

Resources

Contact Us

Your feedback is very important to us. Please feel free to contact us using our Support Forums.

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

groupdocs_conversion_cloud-26.4.tar.gz (79.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

groupdocs_conversion_cloud-26.4-py3-none-any.whl (218.4 kB view details)

Uploaded Python 3

File details

Details for the file groupdocs_conversion_cloud-26.4.tar.gz.

File metadata

File hashes

Hashes for groupdocs_conversion_cloud-26.4.tar.gz
Algorithm Hash digest
SHA256 6a8edef19d28e2ffb47182887d171e8c25f12cc84ce046ebe8460a1be9d9392d
MD5 1e71b6a6cd33236cd019d7af5bc91d26
BLAKE2b-256 effac32140b7de9e9aa254f06a4c8f2f2a219f8ef37f41a89c331e838c752a49

See more details on using hashes here.

File details

Details for the file groupdocs_conversion_cloud-26.4-py3-none-any.whl.

File metadata

File hashes

Hashes for groupdocs_conversion_cloud-26.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1201655ea565589e0ab6c17e82ea57053386a4576f90b3e51d27798d91d52a55
MD5 dbbdc47654fa016bae9bd58aa3d2e8d9
BLAKE2b-256 103774c391815f3cf4133eaf5d507a59e63edc080431dda169b7e67a720c75ec

See more details on using hashes here.

Supported by

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