Skip to content

Commit 578a9c3

Browse files
Cumulative commit - moving to GitHub
1 parent a68be40 commit 578a9c3

File tree

187 files changed

+49012
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+49012
-47
lines changed

.gitignore

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__/
88

99
# Distribution / packaging
1010
.Python
11+
env/
1112
build/
1213
develop-eggs/
1314
dist/
@@ -19,11 +20,9 @@ lib64/
1920
parts/
2021
sdist/
2122
var/
22-
wheels/
2323
*.egg-info/
2424
.installed.cfg
2525
*.egg
26-
MANIFEST
2726

2827
# PyInstaller
2928
# Usually these files are written by a python script from a template
@@ -43,62 +42,25 @@ htmlcov/
4342
.cache
4443
nosetests.xml
4544
coverage.xml
46-
*.cover
45+
*,cover
4746
.hypothesis/
48-
.pytest_cache/
47+
venv/
48+
.python-version
4949

5050
# Translations
5151
*.mo
5252
*.pot
5353

5454
# Django stuff:
5555
*.log
56-
local_settings.py
57-
db.sqlite3
58-
59-
# Flask stuff:
60-
instance/
61-
.webassets-cache
62-
63-
# Scrapy stuff:
64-
.scrapy
6556

6657
# Sphinx documentation
6758
docs/_build/
6859

6960
# PyBuilder
7061
target/
7162

72-
# Jupyter Notebook
63+
#Ipython Notebook
7364
.ipynb_checkpoints
7465

75-
# pyenv
76-
.python-version
77-
78-
# celery beat schedule file
79-
celerybeat-schedule
80-
81-
# SageMath parsed files
82-
*.sage.py
83-
84-
# Environments
85-
.env
86-
.venv
87-
env/
88-
venv/
89-
ENV/
90-
env.bak/
91-
venv.bak/
92-
93-
# Spyder project settings
94-
.spyderproject
95-
.spyproject
96-
97-
# Rope project settings
98-
.ropeproject
99-
100-
# mkdocs documentation
101-
/site
102-
103-
# mypy
104-
.mypy_cache/
66+
.idea/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 aspose-html-cloud
3+
Copyright (c) 2018 Aspose Pty Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,91 @@
1-
# aspose-html-cloud-python
2-
Python library for communicating with the Aspose.HTML for Cloud API
1+
# Aspose.HTML Cloud SDK for Python
2+
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.
3+
4+
See [API Reference](https://apireference.aspose.cloud/html/) for full API specification.
5+
## How to use the SDK?
6+
The complete source code is available in this repository folder, you can either directly use it in your project via pip package manager.
7+
8+
### Prerequisites
9+
10+
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).
11+
12+
### Installation
13+
14+
#### Install Aspose.HTML Cloud
15+
16+
From the command line:
17+
```code
18+
python setup.py install
19+
```
20+
21+
### Sample usage
22+
23+
Before fill all fields in /setting/config.json
24+
25+
Example:
26+
```json
27+
{
28+
"basePath":"https://api.aspose.cloud/v1.1",
29+
"authPath":"https://api.aspose.cloud/oauth2/token",
30+
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
31+
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
32+
"testResult":"/testresult/",
33+
"testData":"/testdata/",
34+
"remoteFolder":"HtmlTestDoc/",
35+
"defaultUserAgent":"Webkit",
36+
"debugFile":"debug.log",
37+
"debug":false
38+
}
39+
```
40+
41+
42+
The examples below show how your application have to initiate and convert url to image using Aspose.HTML Cloud library:
43+
```python
44+
import os
45+
from asposehtmlcloud.api.conversion_api import ConversionApi
46+
from asposehtmlcloud.rest import ApiException
47+
from shutil import copy2
48+
49+
api = ConversionApi()
50+
51+
source_url = "https://stallman.org/articles/anonymous-payments-thru-phones.html"
52+
try:
53+
54+
# Convert url to image
55+
res = api.conversion_get_convert_document_to_image_by_url(
56+
source_url, out_format="jpeg", width=800, height=1000, left_margin=50, right_margin=100,
57+
top_margin=150, bottom_margin=200, x_resolution=300, y_resolution=300,
58+
folder=TestHelper.folder, storage=""
59+
)
60+
61+
src = str(res)
62+
# Move to test folder
63+
if os.path.isfile(src):
64+
copy2(src, '/home/user/testfolder/')
65+
os.remove(src)
66+
except ApiException as ex:
67+
print("Exception")
68+
print("Info: " + str(ex))
69+
raise ex
70+
71+
# ...
72+
```
73+
74+
[Tests](./test/) contain various examples of using the Aspose.HTML SDK.
75+
76+
[Docs](./docs/html/_build/html/) Full documentation for Aspose.HTML Api SDK
77+
78+
79+
Aspose HTML includes Aspose.Storage.Cloud to manipulate files on a remote server. This is used in tests for download test files to the server.
80+
81+
[Tests](./teststorageapi/) contain various examples of using the Aspose.Storage SDK.
82+
83+
[Docs](./docs/storage/_build/html/) Full documentation for Aspose.Storage Api SDK
84+
85+
86+
## Dependencies
87+
- [See requirements.txt](./requirements.txt)
88+
89+
90+
## Contact Us
91+
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.aspose.cloud/html).

asposehtmlcloud/__init__.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# coding: utf-8
2+
3+
# flake8: noqa
4+
5+
"""
6+
--------------------------------------------------------------------------------------------------------------------
7+
<copyright company="Aspose" file="__init__.py">
8+
Copyright (c) 2018 Aspose.HTML for Cloud
9+
</copyright>
10+
<summary>
11+
Permission is hereby granted, free of charge, to any person obtaining a copy
12+
of this software and associated documentation files (the "Software"), to deal
13+
in the Software without restriction, including without limitation the rights
14+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
copies of the Software, and to permit persons to whom the Software is
16+
furnished to do so, subject to the following conditions:
17+
18+
The above copyright notice and this permission notice shall be included in all
19+
copies or substantial portions of the Software.
20+
21+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27+
SOFTWARE.
28+
</summary>
29+
--------------------------------------------------------------------------------------------------------------------
30+
"""
31+
32+
33+
from __future__ import absolute_import
34+
35+
# import apis into sdk package
36+
from asposehtmlcloud.api.document_api import DocumentApi
37+
38+
# import ApiClient
39+
from asposehtmlcloud.api_client import ApiClient
40+
from asposehtmlcloud.configuration import Configuration
41+
# import models into sdk package

asposehtmlcloud/api/__init__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
"""
3+
--------------------------------------------------------------------------------------------------------------------
4+
<copyright company="Aspose" file="__init__.py">
5+
Copyright (c) 2018 Aspose.HTML for Cloud
6+
</copyright>
7+
<summary>
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in all
16+
copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
SOFTWARE.
25+
</summary>
26+
--------------------------------------------------------------------------------------------------------------------
27+
"""

0 commit comments

Comments
 (0)