|
1 | | -# GroupDocs.Conversion Cloud Python SDK |
| 1 | +     [](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python/blob/master/LICENSE) |
2 | 2 |
|
3 | | -Python package for communicating with the GroupDocs.Conversion Cloud API |
| 3 | +# Python SDK to Convert Documents in the Cloud |
4 | 4 |
|
5 | | -## Requirements |
| 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 | 6 |
|
7 | | -Python 2.7 or 3.4+ |
| 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 | 8 |
|
9 | | -## Installation |
| 9 | +## Document Conversion REST API |
10 | 10 |
|
11 | | -Install `groupdocs-conversion-cloud` with [PIP](https://pypi.org/project/pip/) from [PyPI](https://pypi.org/) by: |
| 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. |
12 | 52 |
|
13 | 53 | ```sh |
14 | 54 | pip install groupdocs-conversion-cloud |
15 | 55 | ``` |
16 | 56 |
|
17 | | -Or clone repository and install it via [Setuptools](http://pypi.python.org/pypi/setuptools): |
| 57 | +Or clone this repository and install it via [Setuptools](http://pypi.python.org/pypi/setuptools). |
18 | 58 |
|
19 | 59 | ```sh |
20 | 60 | python setup.py install |
21 | 61 | ``` |
22 | 62 |
|
23 | | -## Getting Started |
24 | | - |
25 | | -Please follow the [installation procedure](#installation) and then run following: |
| 63 | +## Convert DOCX to PDF in the Cloud |
26 | 64 |
|
27 | 65 | ```python |
28 | | -# Import module |
29 | 66 | import groupdocs_conversion_cloud |
30 | 67 |
|
31 | | -# Get your app_sid and app_key at https://dashboard.groupdocs.cloud (free registration is required). |
32 | | -app_sid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" |
33 | | -app_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" |
| 68 | +app_sid = "XXXX-XXXX-XXXX-XXXX" |
| 69 | +app_key = "XXXXXXXXXXXXXXXX" |
34 | 70 |
|
35 | | -# Create instance of the API |
36 | | -api = groupdocs_conversion_cloud.InfoApi.from_keys(app_sid, app_key) |
| 71 | +# Create necessary API instances |
| 72 | +apiInstance = groupdocs_conversion_cloud.ConvertApi.from_keys(Common.app_sid, Common.app_key) |
37 | 73 |
|
38 | | -try: |
39 | | - # Retrieve supported conversion types |
40 | | - request = groupdocs_conversion_cloud.GetSupportedConversionTypesRequest() |
41 | | - response = api.get_supported_conversion_types(request) |
| 74 | +# Prepare convert settings |
| 75 | +settings = groupdocs_conversion_cloud.ConvertSettings() |
| 76 | +settings.file_path = "WordProcessing/four-pages.docx" |
| 77 | +settings.format = "pdf" |
| 78 | +settings.output_path = "converted" |
42 | 79 |
|
43 | | - # Print out supported conversion types |
44 | | - print("Supported conversion types:") |
45 | | - for format in response: |
46 | | - print('{0} to [{1}]'.format(format.source_format, ', '.join(format.target_formats))) |
47 | | -except groupdocs_conversion_cloud.ApiException as e: |
48 | | - print("Exception when calling get_supported_conversion_types: {0}".format(e.message)) |
| 80 | +# Convert |
| 81 | +result = apiInstance.convert_document(groupdocs_conversion_cloud.ConvertDocumentRequest(settings)) |
49 | 82 | ``` |
50 | 83 |
|
51 | | -## Licensing |
52 | | - |
53 | | -GroupDocs.Conversion Cloud Python SDK licensed under [MIT License](http://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python/LICENSE). |
54 | | - |
55 | | -## Resources |
56 | | - |
57 | | -+ [**Website**](https://www.groupdocs.cloud) |
58 | | -+ [**Product Home**](https://products.groupdocs.cloud/conversion) |
59 | | -+ [**Documentation**](https://docs.groupdocs.cloud/conversion) |
60 | | -+ [**Free Support Forum**](https://forum.groupdocs.cloud/c/conversion) |
61 | | -+ [**Blog**](https://blog.groupdocs.cloud/category/conversion) |
| 84 | +## GroupDocs.Conversion Cloud SDKs in Popular Languages |
62 | 85 |
|
63 | | -## Contact Us |
| 86 | +| .NET | Java | PHP | Python | Ruby | Node.js | Android | |
| 87 | +|---|---|---|---|---|---|---| |
| 88 | +| [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) | |
| 89 | +| [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) | | |
64 | 90 |
|
65 | | -Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/conversion). |
| 91 | +[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) |
0 commit comments