# 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](https://www.aspose.cloud/) and lookup/create App Key and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/#/apps). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing).
### Installation
#### Install Aspose.HTML Cloud
From the command line:
```code
python setup.py install
```
#### pip
```code
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
```python
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](doc/ConvertLocalToLocal.md)** | Convert a document from local disk to a local disk. |
| **[convert_local_to_storage](doc/ConvertLocalToStorage.md)** | Convert a document from local disk to user's storage. |
| **[convert_storage_to_local](doc/ConvertStorageToLocal.md)** | Convert a document from user's storage to local disk. |
| **[convert_storage_to_storage](doc/ConvertStorageToStorage.md)** | Convert a document from user's storage to user's storage. |
| **[convert_url_to_local](doc/ConvertUrlToLocal.md)** | Convert the HTML document by URL to local disk. |
| **[convert_url_to_storage](doc/ConvertUrlToStorage.md)** | Convert the HTML document by URL to user's storage. |
| **[convert](doc/Convert.md)** | Convert a document to the specified format. |
## VectorizeApi
- For vectorization images to svg format.
| Method | Description |
|----------------------------------------------------------------------|---------------------------------------------------------|
| **[vectorize_local_to_local](doc/VectorizeLocalToLocal.md)** | Vectorize images from local disk to a local disk. |
| **[vectorize_local_to_storage](doc/VectorizeLocalToStorage.md)** | Vectorize images from local disk to user's storage. |
| **[vectorize_storage_to_local](doc/VectorizeStorageToLocal.md)** | Vectorize images from user's storage to local disk. |
| **[vectorize_storage_to_storage](doc/VectorizeStorageToStorage.md)** | Vectorize images from user's storage to user's storage. |
| **[vectorize](doc/Vectorize.md)** | Vectorize images to the svg format. |
# Documentation for Storage API Endpoints
## StorageApi
| Method | HTTP request | Description |
|-------------------------------------------------|-------------------------------------|-------------------------------------------|
| **[delete_file](doc/DeleteFile.md)** | **DELETE** /html/file/ | Delete file |
| **[download_file](doc/DownloadFile.md)** | **GET** /html/storage/file | Download file |
| **[upload_file](doc/UploadFile.md)** | **POST** /html/storage/file | Upload file |
| **[create_folder](doc/CreateFolder.md)** | **POST** /html/folder | Create the folder |
| **[delete_folder](doc/DeleteFolder.md)** | **DELETE** /html/folder | Delete folder |
| **[get_files_list](doc/GetFilesList.md)** | **GET** /html/folder | Get all files and folders within a folder |
| **[get_disc_usage](doc/GetDiscUsage.md)** | **GET** /html/storage/disc | Get disc usage |
| **[object_exists](doc/ObjectExists.md)** | **GET** /html/storage/exist | Check if file or folder exists |
| **[storage_exists](doc/StorageExists.md)** | **GET** /html/storage/exist/storage | Check if storage exists |
[Tests](test/) contain various examples of using the Aspose.HTML SDK.
[Docs](html_doc/) Full documentation for Aspose.HTML SDK in html format.
## Dependencies
- [See requirements.txt](requirements.txt)
## Contact Us
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.aspose.cloud/html).
Raw data
{
"_id": null,
"home_page": "https://github.com/aspose-html-cloud/aspose-html-cloud-python",
"name": "asposehtmlcloud",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "html2pdf,epub2pdf,md2html,html2md,html2img,html2xps,epub2xps,convert",
"author": "Aspose",
"author_email": "alexander.makogon@aspose.com",
"download_url": "",
"platform": null,
"description": "# Aspose.HTML Cloud SDK for Python\nThis 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.\n\n## How to use the SDK?\nThe complete source code is available in this repository folder, you can either directly use it in your project via pip package manager.\n\n### Prerequisites\n\nTo use Aspose HTML for Cloud Python SDK you need to register an account with [Aspose Cloud](https://www.aspose.cloud/) and lookup/create App Key and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/#/apps). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing).\n\n### Installation\n\n#### Install Aspose.HTML Cloud \n\nFrom the command line:\n```code\n\tpython setup.py install\n```\n\n#### pip\n```code\npip install asposehtmlcloud\n```\n\n## Example\n\nThe examples below show how your application have to initiate and convert url to image using Aspose.HTML Cloud library:\n\nPossible conversions: \n- HTML -> PDF, XPS, DOCX, MD, MHTML, JPEG, BMP, PNG, TIFF, GIF\n- EPUB -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF\n- MD -> PDF, XPS, DOCX, HTML, MHTML, JPEG, BMP, PNG, TIFF, GIF\n- MHTML -> PDF, XPS, DOCX, JPEG, BMP, PNG, TIFF, GIF\n- SVG -> PDF, XPS, JPEG, BMP, PNG, TIFF, GIF\n- JPEG, BMP, PNG, TIFF, GIF -> SVG\n\n```python\nimport os\nfrom asposehtmlcloud.configuration import Configuration\nfrom asposehtmlcloud.api.html_api import HtmlApi\nfrom asposehtmlcloud.api_client import ApiClient as Client\nfrom asposehtmlcloud.rest import ApiException\n\n# Get keys from aspose site.\n# There is free quota available. \n# For more details, see https://purchase.aspose.cloud/pricing\n\nconfiguration = Configuration(apiKey=\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n appSid=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",\n basePath=\"https://api.aspose.cloud/v4.0\",\n authPath=\"https://api.aspose.cloud/connect/token\",\n debug=True)\n\nclient = Client(configuration)\nhtml_api = HtmlApi(client)\n\nsource_url = \"https://stallman.org/articles/anonymous-payments-thru-phones.html\"\ntry:\n res = html_api.convert_url_to_local(input_file=source_url, output_file=\"result.pdf\")\n if not os.path.exists(res.file):\n print('conversion failed')\nexcept ApiException as ex:\n print(\"Exception\")\n print(\"Info: \" + str(ex))\n raise ex\n\n```\n\n# Documentation for Html API Endpoints\n\nAll URIs are relative to *https://api.aspose.cloud/v4.0*\n\n## ConversionApi \n\n- See possible conversions.\n| Method | Description |\n|------------------------------------------------------------------|-----------------------------------------------------------|\n| **[convert_local_to_local](doc/ConvertLocalToLocal.md)** | Convert a document from local disk to a local disk. |\n| **[convert_local_to_storage](doc/ConvertLocalToStorage.md)** | Convert a document from local disk to user's storage. |\n| **[convert_storage_to_local](doc/ConvertStorageToLocal.md)** | Convert a document from user's storage to local disk. |\n| **[convert_storage_to_storage](doc/ConvertStorageToStorage.md)** | Convert a document from user's storage to user's storage. |\n| **[convert_url_to_local](doc/ConvertUrlToLocal.md)** | Convert the HTML document by URL to local disk. |\n| **[convert_url_to_storage](doc/ConvertUrlToStorage.md)** | Convert the HTML document by URL to user's storage. |\n| **[convert](doc/Convert.md)** | Convert a document to the specified format. |\n\n\n## VectorizeApi \n\n- For vectorization images to svg format.\n| Method | Description |\n|----------------------------------------------------------------------|---------------------------------------------------------|\n| **[vectorize_local_to_local](doc/VectorizeLocalToLocal.md)** | Vectorize images from local disk to a local disk. |\n| **[vectorize_local_to_storage](doc/VectorizeLocalToStorage.md)** | Vectorize images from local disk to user's storage. |\n| **[vectorize_storage_to_local](doc/VectorizeStorageToLocal.md)** | Vectorize images from user's storage to local disk. |\n| **[vectorize_storage_to_storage](doc/VectorizeStorageToStorage.md)** | Vectorize images from user's storage to user's storage. |\n| **[vectorize](doc/Vectorize.md)** | Vectorize images to the svg format. |\n\n\n# Documentation for Storage API Endpoints\n\n## StorageApi\n\n| Method | HTTP request | Description |\n|-------------------------------------------------|-------------------------------------|-------------------------------------------|\n| **[delete_file](doc/DeleteFile.md)** | **DELETE** /html/file/ | Delete file |\n| **[download_file](doc/DownloadFile.md)** | **GET** /html/storage/file | Download file |\n| **[upload_file](doc/UploadFile.md)** | **POST** /html/storage/file | Upload file |\n| **[create_folder](doc/CreateFolder.md)** | **POST** /html/folder | Create the folder |\n| **[delete_folder](doc/DeleteFolder.md)** | **DELETE** /html/folder | Delete folder |\n| **[get_files_list](doc/GetFilesList.md)** | **GET** /html/folder | Get all files and folders within a folder |\n| **[get_disc_usage](doc/GetDiscUsage.md)** | **GET** /html/storage/disc | Get disc usage |\n| **[object_exists](doc/ObjectExists.md)** | **GET** /html/storage/exist | Check if file or folder exists |\n| **[storage_exists](doc/StorageExists.md)** | **GET** /html/storage/exist/storage | Check if storage exists |\n\n\n[Tests](test/) contain various examples of using the Aspose.HTML SDK.\n\n[Docs](html_doc/) Full documentation for Aspose.HTML SDK in html format.\n\n## Dependencies\n- [See requirements.txt](requirements.txt)\n\n## Contact Us\nYour feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.aspose.cloud/html).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Aspose.HTML for Cloud Python SDK",
"version": "22.12.1",
"split_keywords": [
"html2pdf",
"epub2pdf",
"md2html",
"html2md",
"html2img",
"html2xps",
"epub2xps",
"convert"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "c058f9489e17b8d505be7011eed6dac2",
"sha256": "8e4dfd4e43fa76132098af34e86930b9203d2c461531543bda0ed61cc70663de"
},
"downloads": -1,
"filename": "asposehtmlcloud-22.12.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c058f9489e17b8d505be7011eed6dac2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 68042,
"upload_time": "2022-12-15T13:44:54",
"upload_time_iso_8601": "2022-12-15T13:44:54.397908Z",
"url": "https://files.pythonhosted.org/packages/92/69/b6b9eb6a641d3b1d85438e8ab5a6d09ca05ebacbe500117da1df210497e7/asposehtmlcloud-22.12.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-15 13:44:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "aspose-html-cloud",
"github_project": "aspose-html-cloud-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "asposehtmlcloud"
}