GroupDocs.Viewer Cloud Python SDK
Project description
GroupDocs.Viewer Cloud Python SDK
Python package for communicating with the GroupDocs.Viewer Cloud API. This SDK allows you to work with GroupDocs.Viewer Cloud REST APIs in your python applications, which allows rendering a specific document in HTML, image or PDF format with the flexibility to render the whole document or custom range of pages.
Requirements
Python 3.4+
Installation
Install groupdocs-viewer-cloud with PIP from PyPI by:
pip install groupdocs-viewer-cloud
Or clone repository and install it via Setuptools:
python setup.py install
Getting Started
Please follow the installation procedure and then run following:
# Import module
import groupdocs_viewer_cloud
# Get your app_sid and app_key at https://dashboard.groupdocs.cloud (free registration is required).
client_id = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
client_secret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
apiInstance = groupdocs_viewer_cloud.ViewApi.from_keys(client_id, client_secret)
format = "jpg"
file = File.open("myfile.txt", "r")
request = ConvertAndDownloadRequest.new format, file
response = apiInstance.convert_and_download(request)
Below is an example demonstrating how to upload the document, render it, and download the result using GroupDocs.Viewer Cloud SDK for Python.
# Import module
import groupdocs_viewer_cloud
# Get your app_sid and app_key at https://dashboard.groupdocs.cloud (free registration is required).
client_id = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
client_secret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Upload input file to cloud storage
fileApiInstance = groupdocs_viewer_cloud.FileApi.from_keys(client_id, client_secret)
request = groupdocs_viewer_cloud.UploadFileRequest("myfile.txt", "C:\\Data\\myfile.txt")
fileApiInstance.upload_file(request)
# Render to html format
apiInstance = groupdocs_viewer_cloud.ViewApi.from_keys(client_id, client_secret)
view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "myfile.txt"
view_options.view_format = "HTML"
view_options.output_path = "myfile.html"
request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
response = apiInstance.create_view(request)
# Download result
request = groupdocs_viewer_cloud.DownloadFileRequest("myfile.html")
response = fileApiInstance.download_file(request)
print("Expected response type is Stream: " + str(len(response)))
Licensing
GroupDocs.Viewer 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file groupdocs_viewer_cloud-26.6.tar.gz.
File metadata
- Download URL: groupdocs_viewer_cloud-26.6.tar.gz
- Upload date:
- Size: 65.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15c7f93db247374494fd63437fb31742e2e53359b9c2b932c012fcee651a3f37
|
|
| MD5 |
231165e05d9265f1db7edd80cad6c5c5
|
|
| BLAKE2b-256 |
34b4fb271facfb73abc6b7383b5b41ede9192fb5abb0bdcf2ee7efb008b9247f
|
File details
Details for the file groupdocs_viewer_cloud-26.6-py3-none-any.whl.
File metadata
- Download URL: groupdocs_viewer_cloud-26.6-py3-none-any.whl
- Upload date:
- Size: 183.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
978986dc2debfef85039d81755577a4ddfceb3a57de9529986d8aa618780e095
|
|
| MD5 |
5cb74808f9002f3d1bc43e355231dc85
|
|
| BLAKE2b-256 |
5665346dc5601065ce1d43934dad1a5a26004fabb4be6a8c907e6667ec6478e5
|