Skip to main content

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:

Possible conversions:

  • HTML -> PDF, XPS, DOCX, MD, MHTML, JPEG, BMP, PNG, TIFF, GIF
  • EPUB -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
  • MD -> PDF, XPS, DOCX, HTML, MHTML, JPEG, BMP, PNG, TIFF, GIF
  • MHTML -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF
  • SVG -> PDF, XPS, JPEG, BMP, PNG, TIFF, GIF
  • JPEG, BMP, PNG, TIFF, GIF -> SVG
import os
from asposehtmlcloud.configuration import Configuration
from asposehtmlcloud.api.html_api import HtmlApi
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)

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.file):
        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

  • See possible conversions. | Method | Description | |------------------------------------------------------------------|-----------------------------------------------------------| | convert_local_to_local | Convert a document from local disk to a local disk. | | convert_local_to_storage | Convert a document from local disk to user's storage. | | convert_storage_to_local | Convert a document from user's storage to local disk. | | convert_storage_to_storage | Convert a 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 a document to the specified format. |

VectorizeApi

  • For vectorization images to svg format. | Method | Description | |----------------------------------------------------------------------|---------------------------------------------------------| | vectorize_local_to_local | Vectorize images from local disk to a local disk. | | vectorize_local_to_storage | Vectorize images from local disk to user's storage. | | vectorize_storage_to_local | Vectorize images from user's storage to local disk. | | vectorize_storage_to_storage | Vectorize images from user's storage to user's storage. | | vectorize | Vectorize images to the svg 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asposehtmlcloud-25.10.1.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

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

asposehtmlcloud-25.10.1-py3-none-any.whl (68.6 kB view details)

Uploaded Python 3

File details

Details for the file asposehtmlcloud-25.10.1.tar.gz.

File metadata

  • Download URL: asposehtmlcloud-25.10.1.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for asposehtmlcloud-25.10.1.tar.gz
Algorithm Hash digest
SHA256 2921f7edc1338392fdcc19729aa17c10dce81abf2a98536a1b347fec0e52f2d3
MD5 b85280cc3d1afe2d4b554bf76ddd8d47
BLAKE2b-256 07e627c386d032acb85c50ffe02dd58dced45c6d1d83ab964eb3324cbdfff886

See more details on using hashes here.

File details

Details for the file asposehtmlcloud-25.10.1-py3-none-any.whl.

File metadata

File hashes

Hashes for asposehtmlcloud-25.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de18c0b3c49b7825721fc7c760a102beceebcb7e7847417a845ecdef11f5838b
MD5 65e87df7e72a3d42fbc28e37db6e6f49
BLAKE2b-256 5e2b5f3071af984aa33ddff83b9638a361ea2a0b6f286be6dc7fa14849163244

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