convertapi
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: convertapi | ||
| Version: 1.5.0 | ||
| Version: 1.6.0 | ||
| Summary: Convert API Python Client | ||
| Home-page: https://github.com/ConvertAPI/convertapi-python | ||
| Download-URL: https://github.com/ConvertAPI/convertapi-python | ||
| Author: Tomas Rutkauskas | ||
| Author-email: support@convertapi.com | ||
| License: MIT | ||
| Download-URL: https://github.com/ConvertAPI/convertapi-python | ||
| Keywords: convert,api,client,conversion | ||
| Platform: UNKNOWN | ||
| License-File: LICENSE.txt | ||
| Convert various files like MS Word, Excel, PowerPoint, Images to PDF and Images. Create PDF and Images from url and raw HTML. Extract and create PowerPoint presentation from PDF. Merge, Encrypt, Split, Repair and Decrypt PDF files. All supported files conversions and manipulations can be found at https://www.convertapi.com/doc/supported-formats | ||
@@ -1,2 +0,2 @@ | ||
| __version__ = '1.5.0' | ||
| __version__ = '1.6.0' | ||
@@ -19,3 +19,4 @@ from .exceptions import * | ||
| max_parallel_uploads = 10 | ||
| verify_ssl = True | ||
| client = Client() |
+20
-17
@@ -9,10 +9,12 @@ import requests | ||
| def get(self, path, params = {}, timeout = None): | ||
| url = self.__url(path) | ||
| timeout = timeout or convertapi.timeout | ||
| r = requests.get(self.url(path), params = params, headers = self.headers(), timeout = timeout) | ||
| return self.handle_response(r) | ||
| r = self.__session().get(url, params = params, timeout = timeout) | ||
| return self.__handle_response(r) | ||
| def post(self, path, payload, timeout = None): | ||
| url = self.__url(path) | ||
| timeout = timeout or convertapi.timeout | ||
| r = requests.post(self.url(path), data = payload, headers = self.headers(), timeout = timeout) | ||
| return self.handle_response(r) | ||
| r = self.__session().post(url, data = payload, timeout = timeout) | ||
| return self.__handle_response(r) | ||
@@ -23,12 +25,11 @@ def upload(self, io, filename): | ||
| headers = self.headers() | ||
| headers.update({ | ||
| headers = { | ||
| 'Content-Disposition': "attachment; filename*=UTF-8''" + encoded_filename, | ||
| }) | ||
| } | ||
| r = requests.post(url, data = io, headers = headers, timeout = convertapi.upload_timeout) | ||
| return self.handle_response(r) | ||
| r = self.__session().post(url, data = io, headers = headers, timeout = convertapi.upload_timeout) | ||
| return self.__handle_response(r) | ||
| def download(self, url, path): | ||
| r = requests.get(url, stream = True, timeout = convertapi.download_timeout) | ||
| r = self.__session().get(url, stream = True, timeout = convertapi.download_timeout) | ||
@@ -43,6 +44,6 @@ with open(path, 'wb') as f: | ||
| def download_io(self, url): | ||
| response = requests.get(url, timeout = convertapi.download_timeout) | ||
| response = self.__session().get(url, timeout = convertapi.download_timeout) | ||
| return BytesIO(response.content) | ||
| def handle_response(self, r): | ||
| def __handle_response(self, r): | ||
| try: | ||
@@ -58,8 +59,10 @@ r.raise_for_status() | ||
| def url(self, path): | ||
| def __url(self, path): | ||
| return "%s%s?Secret=%s" % (convertapi.base_uri, path, convertapi.api_secret) | ||
| def headers(self): | ||
| return { | ||
| 'User-Agent': convertapi.user_agent, | ||
| } | ||
| def __session(self): | ||
| s = requests.Session() | ||
| s.headers.update({ 'User-Agent': convertapi.user_agent }) | ||
| s.verify = convertapi.verify_ssl | ||
| return s |
+4
-2
| Metadata-Version: 2.1 | ||
| Name: convertapi | ||
| Version: 1.5.0 | ||
| Version: 1.6.0 | ||
| Summary: Convert API Python Client | ||
| Home-page: https://github.com/ConvertAPI/convertapi-python | ||
| Download-URL: https://github.com/ConvertAPI/convertapi-python | ||
| Author: Tomas Rutkauskas | ||
| Author-email: support@convertapi.com | ||
| License: MIT | ||
| Download-URL: https://github.com/ConvertAPI/convertapi-python | ||
| Keywords: convert,api,client,conversion | ||
| Platform: UNKNOWN | ||
| License-File: LICENSE.txt | ||
| Convert various files like MS Word, Excel, PowerPoint, Images to PDF and Images. Create PDF and Images from url and raw HTML. Extract and create PowerPoint presentation from PDF. Merge, Encrypt, Split, Repair and Decrypt PDF files. All supported files conversions and manipulations can be found at https://www.convertapi.com/doc/supported-formats | ||
+1
-1
@@ -50,3 +50,3 @@ # ConvertAPI Python Client | ||
| Convert a file to PDF example. All supported file formats and options can be found | ||
| [here](https://www.convertapi.com). | ||
| [here](https://www.convertapi.com/conversions). | ||
@@ -53,0 +53,0 @@ ```python |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
15821
0.89%255
1.19%