|
1 | | -     [](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python/blob/master/LICENSE) |
| 1 | +# GroupDocs.Conversion Cloud Python SDK |
| 2 | +Python package for communicating with the GroupDocs.Conversion Cloud API |
2 | 3 |
|
3 | | -# Python SDK to Convert Documents in the Cloud |
| 4 | +## Requirements |
4 | 5 |
|
5 | | -[GroupDocs.Conversion Cloud SDK for Python](https://products.groupdocs.cloud/conversion/python) wraps GroupDocs.Conversion RESTful APIs so you may integrate **Document Conversion** features in your own apps with zero initial cost. |
| 6 | +Python 2.7 or 3.4+ |
6 | 7 |
|
7 | | -GroupDocs.Conversion Cloud API allows the developers to convert between 50+ file formats including Word documents, Excel spreadsheets, PowerPoint presentations, PDF, OpenDocument files, images & more. |
8 | | - |
9 | | -## Document Conversion REST API |
10 | | - |
11 | | -- Convert the whole document to the desired target format. |
12 | | -- Convert specific document page(s) or a page range. |
13 | | -- Auto-detect source document format without requiring the file extension. |
14 | | -- Load source document with extended options, such as specify password for password-protected documents. |
15 | | -- Load specific part of the document. |
16 | | -- Show or hide document comments. |
17 | | -- Obtain all supported conversion formats list. |
18 | | -- Replace missing fonts with any other font. |
19 | | -- Add text or image watermarks to any page. |
20 | | -- Specify resolution and quality for resultant images. |
21 | | -- Extract metadata & basic information about the source document. |
22 | | -- Integrated storage API. |
23 | | - |
24 | | -Check out the [Developer's Guide](https://docs.groupdocs.cloud/conversion/developer-guide/) to know more about GroupDocs.Conversion REST API. |
25 | | - |
26 | | -## Microsoft File Formats |
27 | | - |
28 | | -**Microsoft Word:** DOC, DOCM, DOCX, DOT, DOTM, DOTX\ |
29 | | -**Microsoft Excel:** XLS, XLSX, XLSB, XLSM\ |
30 | | -**Microsoft PowerPoint:** PPT, PPTX, PPS, PPSX\ |
31 | | -**Microsoft Project:** MPP, MPT\ |
32 | | -**Microsoft Outlook:** MSG, EML\ |
33 | | -**Microsoft Visio:** VSD, VDX, VSS, VSX, VST, VTX, VSDX, VDW, VSSX, VSTX, VSDM, VSTM, VSSM\ |
34 | | -**Microsoft OneNote:** ONE |
35 | | - |
36 | | -## Other Formats |
37 | | - |
38 | | -**Page Layout Formats:** PDF, XPS\ |
39 | | -**OpenDocument:** ODT, OTT, ODS, ODP, OTP, OTS, ODG\ |
40 | | -**CAD:** DXF, DWG, IFC, STL\ |
41 | | -**Images:** DCM, BMP, GIF, JPG, PNG, TIFF, WebP, DjVu, SVG, DNG, ICO\ |
42 | | -**Web:** HTML, MHT, MHTML\ |
43 | | -**Emails:** EML, EMLX\ |
44 | | -**eBooks:** EPUB, MOBI\ |
45 | | -**Metafile:** WMF, EMF\ |
46 | | -**LaTeX:** TEX\ |
47 | | -**Others:** TXT, RTF, CSV, TSV, XML |
48 | | - |
49 | | -## Get Started with GroupDocs.Conversion Cloud SDK for Python |
50 | | - |
51 | | -First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, execute the following command. |
| 8 | +## Installation |
| 9 | +Install `groupdocs-conversion-cloud` with [PIP](https://pypi.org/project/pip/) from [PyPI](https://pypi.org/) by: |
52 | 10 |
|
53 | 11 | ```sh |
54 | 12 | pip install groupdocs-conversion-cloud |
55 | 13 | ``` |
56 | 14 |
|
57 | | -Or clone this repository and install it via [Setuptools](http://pypi.python.org/pypi/setuptools). |
| 15 | +Or clone repository and install it via [Setuptools](http://pypi.python.org/pypi/setuptools): |
58 | 16 |
|
59 | 17 | ```sh |
60 | 18 | python setup.py install |
61 | 19 | ``` |
62 | 20 |
|
63 | | -## Convert DOCX to PDF in the Cloud |
| 21 | +## Getting Started |
| 22 | + |
| 23 | +Please follow the [installation procedure](#installation) and then run following: |
64 | 24 |
|
65 | 25 | ```python |
| 26 | +# Import module |
66 | 27 | import groupdocs_conversion_cloud |
67 | 28 |
|
68 | | -# Get Client Id and Client Secret from https://dashboard.groupdocs.cloud |
69 | | -my_client_id = "" |
70 | | -my_client_secret = "" |
| 29 | +# Get your app_sid and app_key at https://dashboard.groupdocs.cloud (free registration is required). |
| 30 | +app_sid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" |
| 31 | +app_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" |
71 | 32 |
|
72 | 33 | # Create instance of the API |
73 | | -configuration = groupdocs_conversion_cloud.Configuration(my_client_id, my_client_secret) |
74 | | -apiInstance = groupdocs_conversion_cloud.ConvertApi.from_config(configuration) |
75 | | - |
76 | | -# Prepare convert settings |
77 | | -settings = groupdocs_conversion_cloud.ConvertSettings() |
78 | | -settings.file_path = "WordProcessing/four-pages.docx" |
79 | | -settings.format = "pdf" |
80 | | -settings.output_path = "converted" |
81 | | - |
82 | | -# Convert |
83 | | -result = apiInstance.convert_document(groupdocs_conversion_cloud.ConvertDocumentRequest(settings)) |
| 34 | +api = groupdocs_conversion_cloud.InfoApi.from_keys(app_sid, app_key) |
| 35 | + |
| 36 | +try: |
| 37 | + # Retrieve supported conversion types |
| 38 | + request = groupdocs_conversion_cloud.GetSupportedConversionTypesRequest() |
| 39 | + response = api.get_supported_conversion_types(request) |
| 40 | + |
| 41 | + # Print out supported conversion types |
| 42 | + print("Supported conversion types:") |
| 43 | + for format in response: |
| 44 | + print('{0} to [{1}]'.format(format.source_format, ', '.join(format.target_formats))) |
| 45 | +except groupdocs_conversion_cloud.ApiException as e: |
| 46 | + print("Exception when calling get_supported_conversion_types: {0}".format(e.message)) |
84 | 47 | ``` |
85 | 48 |
|
86 | | -## GroupDocs.Conversion Cloud SDKs in Popular Languages |
| 49 | +## Licensing |
| 50 | +GroupDocs.Conversion Cloud Python SDK licensed under [MIT License](http://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python/LICENSE). |
87 | 51 |
|
88 | | -| .NET | Java | PHP | Python | Ruby | Node.js | Android | |
89 | | -|---|---|---|---|---|---|---| |
90 | | -| [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-php) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-ruby) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-node) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android) | |
91 | | -| [NuGet](https://www.nuget.org/packages/GroupDocs.Conversion-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-conversion-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-conversion-cloud) | [PIP](https://pypi.org/project/groupdocs-conversion-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_conversion_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-conversion-cloud) | | |
| 52 | +## Resources |
| 53 | ++ [**Website**](https://www.groupdocs.cloud) |
| 54 | ++ [**Product Home**](https://products.groupdocs.cloud/conversion) |
| 55 | ++ [**Documentation**](https://docs.groupdocs.cloud/display/conversioncloud/Home) |
| 56 | ++ [**Free Support Forum**](https://forum.groupdocs.cloud/c/conversion) |
| 57 | ++ [**Blog**](https://blog.groupdocs.cloud/category/conversion) |
92 | 58 |
|
93 | | -[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/conversion/python) | [Documentation](https://docs.groupdocs.cloud/conversion/) | [Live Demo](https://products.groupdocs.app/conversion/total) | [API Reference](https://apireference.groupdocs.cloud/conversion/) | [Code Samples](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python-samples) | [Blog](https://blog.groupdocs.cloud/category/conversion/) | [Free Support](https://forum.groupdocs.cloud/c/conversion) | [Free Trial](https://dashboard.groupdocs.cloud) |
| 59 | +## Contact Us |
| 60 | +Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/conversion). |
0 commit comments