Aspose.HTML for Cloud Python SDK
Project description
Aspose.HTML Cloud SDK for Python
This repository contains Aspose.HTML Cloud SDK for Python source code. This SDK allows you to work with Aspose.HTML Cloud REST APIs in your Python applications quickly and easily.
How to use the SDK?
The complete source code is available in this repository folder, you can either directly use it in your project via pip package manager.
Prerequisites
To use Aspose HTML for Cloud Python SDK you need to register an account with Aspose Cloud and lookup/create App Key and SID at Cloud Dashboard. There is free quota available. For more details, see Aspose Cloud Pricing.
Installation
Install Aspose.HTML Cloud
From the command line:
python setup.py install
pip
pip install asposehtmlcloud
Example
The examples below show how your application have to initiate and convert url to image using Aspose.HTML Cloud library:
import os
from asposehtmlcloud.configuration import Configuration
from asposehtmlcloud.api.html_api import HtmlApi
from asposehtmlcloud.api.storage_api import StorageApi
from asposehtmlcloud.api_client import ApiClient as Client
from asposehtmlcloud.rest import ApiException
# Get keys from aspose site.
# There is free quota available.
# For more details, see https://purchase.aspose.cloud/pricing
configuration = Configuration(apiKey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
appSid="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
basePath="https://api.aspose.cloud/v4.0",
authPath="https://api.aspose.cloud/connect/token",
debug=True)
client = Client(configuration)
html_api = HtmlApi(client)
storage_api = StorageApi(client)
source_url = "https://stallman.org/articles/anonymous-payments-thru-phones.html"
try:
res = html_api.convert_url_to_local(input_file=source_url, output_file="result.pdf")
if not os.path.exists(res.files[0]):
print('conversion failed')
except ApiException as ex:
print("Exception")
print("Info: " + str(ex))
raise ex
Documentation for Html API Endpoints
All URIs are relative to https://api.aspose.cloud/v4.0
ConversionApi
- For conversion to images allowed formats is jpeg, png, bmp, tiff, gif. Input formats are html, epub, svg.
Method | Description |
---|---|
convert_local_to_local | Convert the HTML or EPUB document from local disk to a local disk. |
convert_local_to_storage | Convert the HTML or EPUB document from local disk to user's storage. |
convert_storage_to_local | Convert the HTML or EPUB document from user's storage to local disk. |
convert_storage_to_storage | Convert the HTML or EPUB document from user's storage to user's storage. |
convert_url_to_local | Convert the HTML document by URL to local disk. |
convert_url_to_storage | Convert the HTML document by URL to user's storage. |
convert | Convert the HTML, EPUB or URL to the specified format. |
Documentation for Storage API Endpoints
StorageApi
Method | HTTP request | Description |
---|---|---|
delete_file | DELETE /html/file/ | Delete file |
download_file | GET /html/storage/file | Download file |
upload_file | POST /html/storage/file | Upload file |
create_folder | POST /html/folder | Create the folder |
delete_folder | DELETE /html/folder | Delete folder |
get_files_list | GET /html/folder | Get all files and folders within a folder |
get_disc_usage | GET /html/storage/disc | Get disc usage |
object_exists | GET /html/storage/exist | Check if file or folder exists |
storage_exists | GET /html/storage/exist/storage | Check if storage exists |
Tests contain various examples of using the Aspose.HTML SDK.
Docs Full documentation for Aspose.HTML SDK in html format.
Dependencies
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
Hashes for asposehtmlcloud-22.9.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13848eb65f47c590ee232148f7ac4f1db069b65f7e5d7dbfac7df8f707a35cb2 |
|
MD5 | 0f34309d272d61ccb78616eeaa0fc6a6 |
|
BLAKE2b-256 | e9da51bfa7899022ad90422bf53a2b6bd102666c37e1be4187cea3905ae84df8 |