Package: groupdocs-rewriter-cloud
Python SDK for GroupDocs.Rewriter CloudProduct Page|Documentation|Demos|Swagger UI|Examples|Blog|Search|Free Support|Free TrialGroupDocs.Rewriter Cloudis an easy-to-use and versatile online service for rephrasing the content of Microsoft Word®, OpenOffice, Adobe Acrobat® PDF documents, Markdown and HTML files as well as a plain text with full preservation of their meaning. A powerful neural network reads and understands the text and then paraphrases it with different wording, producing a plagiarism-free result. While the background process is very complex and resource-intensive, you do not have to worry about formulas, machine learning, and load - our cloud services do all the work by providing you with a REST API to interact with them.This software development kit (SDK) simplifies the interaction with GroupDocs.Rewriter Cloud API from Python code, allowing you to focus on the task at hand rather than the technical details. It handles all the routine operations such as establishing connection, sending API requests, and parsing responses, wrapping all these tasks into a few lines of code that are very easy to read and maintain even for inexperienced developers.Before you beginGroupDocs.Rewriter Cloud is an on-demand service. As such, it has no specific hardware or operating system requirements. In order to use the service, you must create an account at GroupDocs Cloud API:Go tohttps://dashboard.groupdocs.cloud/If you are already registered with Aspose, sign in with your user name and password.Otherwise, click Don’t have an account? Sign Up link and create a new account.Check outmore information about available subscription plans and a free tier limits.GroupDocs values your privacy and takes technical, security and organizational measures to protect your data from unauthorized use, accidental loss or disclosure. Read ourPrivacy PolicyandTerms of Servicefor details.How it worksProvide the file in one of the supported formats or a plain text. GroupDocs.Rewriter Cloud API will rephrase it and save the rewritten file to our cloud, or just return the paraphrased text.Supported formatsGroupDocs.Rewriter Cloud can rephrase documents in the most popular formats.DocumentExtensionsDescriptionMicrosoft Word.DOCX.DOCM.DOC.RTFMicrosoft Word 97-2021 and Microsoft 365 Word documents, including macro-enabled documents.Portable Document Format.PDFAn open standard cross-platform format for documents that include formatted text, images, multimedia elements, and more.OpenDocument Text.ODTDocuments created with a number of open source word processing applications, such as Writer from Apache OpenOffice and LibreOffice.Markdown.MDFiles created using one of dialects of the Markdown language.HTML.HTMLFiles containing Hypertext Markup Language (HTML) that formats the structure of a webpage.Plain text.TXTPlain text files or text in the form of lines.In addition to rephrasing, GroupDocs.Rewriter Cloud can save the resulting document in various file formats other than the original, with formatting preserved (where applicable).Source file formatParaphrased file format.DOCX.DOCX.RTF.HTML.ODT.TXT.MD.PDF.TIFF.SVG.XPS.DOC.DOC.DOCX.RTF.HTML.ODT.TXT.MD.PDF.TIFF.SVG.XPS.ODT.DOCX.RTF.HTML.ODT.TXT.MD.PDF.TIFF.SVG.XPS.RTF.DOCX.RTF.HTML.ODT.TXT.MD.PDF.TIFF.SVG.XPS.PDF.PDF.DOCX.PPTX.HTML.XPS.SVG.MD.MD.HTML.HTML.PDF.DOCX.TIFF.XPSSupported languagesar— to paraphrase Arabic text or documentde— to paraphrase German text or documenten— to paraphrase English text or documentes— to paraphrase Spanish text or documentfr— to paraphrase French text or documentid— to paraphrase Indonesian text or documentru— to paraphrase Russian text or documentuk— to paraphrase Ukrainian text or documentQuick startTo start using GroupDocs.Rewriter Cloud in your Python applications, follow a few simple steps:System requirementsSupported versions of Python:2.733.43.53.63.73.8Seerequirements.txtfor the list of dependencies.Getting an access tokenThe GroupDocs.Rewriter Cloud API is fully compliant with industry security standards and best practices. Data transfer is carried out using JWT authentication, which eliminates all possibilities of data theft or disclosure.To obtain a JWT token, get theClient IDandClient Secretcredentials:Sign in toGroupDocs Cloud API Dashboard.Go toApplicationspage.Create thesamplesstorage for exchanging files by clicking theplusicon and following the required steps.Provide the application name.ClickSavebutton.Click the newly created application and copy the values fromClient IdandClient Secretfields. These credentials can be used to access all GroupDocs Cloud services.Now request an access token with the following API call:curl--location--requestPOST'https://api.groupdocs.cloud/connect/token'\--header'Content-Type: application/x-www-form-urlencoded'\--data-urlencode'grant_type=client_credentials'\--data-urlencode'client_id=CLIENT-ID-VALUE'\--data-urlencode'client_secret=CLIENT-SECRET-VALUE'You should get a response that looks something like this:{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...Iwr6g2zbFwf1nLtg","expires_in":3600,"token_type":"Bearer"}The access token will be valid for the number of seconds specified in theexpires_inproperty. If it has expired, request a new one using the same credentials.Installing GroupDocs.Rewriter Python SDKInstallgroupdocs-rewriter-cloudpackage withPIPfromPyPIby executing the following command:pipinstallgroupdocs-rewriter-cloudAlternatively, you can clone the repository and install it viaSetuptools:pythonsetup.pyinstallRunning a demo projectGet the SDK.Set your client_id & client_secret credentials.RunJupyternotebookdemo.ipynbDemo project structureComponentTypeDescriptiongroupdocsrewritercloudModulePython SDK for GroupDocs.Rewriter CloudtestModuleUnit testsdemoNotebookSample Jupyter notebookExamplesThe following code snippets demonstrate how to use the GroupDocs.Rewriter Python SDK to accomplish various tasks.Rewrite a text# Load the gemimportgroupdocs_rewriter_cloud# Get Client Id and Client Secret from https://dashboard.groupdocs.cloudmy_client_id=""my_client_secret=""# Create instance of the APIconfiguration=Configuration(apiKey=my_client_secret,appSid=my_client_id)api=RewriterApi(configuration)language="en"text="GroupDocs Cloud customers come from a wide variety of industries and can be found all over the globe."rewriter=RewriteText(language,text,diversity="medium",suggestions=2)request=rewriter.to_string()output=api.post_rewrite_text(request)print(output.result)Rewrite a Word document# Load the gemimportgroupdocs_rewriter_cloud# Get Client Id and Client Secret from https://dashboard.groupdocs.cloudmy_client_id=""my_client_secret=""# Create instance of the APIconfiguration=Configuration(apiKey=my_client_secret,appSid=my_client_id)api=RewriterApi(configuration)# Document paraphrasinglanguage="en"_format="docx"outformat="docx"storage="internal"name="test_file.docx"folder=""savepath=""savefile="paraphrased.docx"rewriter=RewriteDocument(language,_format,outformat,storage,name,folder,savepath,savefile,diversity="medium")request=rewriter.to_string()output=api.post_rewrite_document(request)print(output.message)SDK also provides a tool for summarizing texts and documents in English. To do this, put the same parameters as for paraphrasing (except for "diversity" and "suggestions") in the requests body.Summarize a text# Load the gemimportgroupdocs_rewriter_cloud# Get Client Id and Client Secret from https://dashboard.groupdocs.cloudmy_client_id=""my_client_secret=""# Create instance of the APIconfiguration=Configuration(apiKey=my_client_secret,appSid=my_client_id)api=RewriterApi(configuration)language="en"text="The modern Olympic Games are the leading international sporting events featuring summer and winter sports competitions in which thousands of athletes from around the world participate in a variety of competitions. The Olympic Games are considered the world's foremost sports competition with more than 200 teams, representing sovereign states and territories, participating. The Olympic Games are normally held every four years, and since 1994, have alternated between the Summer and Winter Olympics every two years during the four-year period."summarizer=SummarizeText(language,text)request=summarizer.to_string()output=api.post_summarize_text(request)print(output.result)Summarize a PDF document# Load the gemimportgroupdocs_rewriter_cloud# Get Client Id and Client Secret from https://dashboard.groupdocs.cloudmy_client_id=""my_client_secret=""# Create instance of the APIconfiguration=Configuration(apiKey=my_client_secret,appSid=my_client_id)api=RewriterApi(configuration)# Document summarizationlanguage="en"_format="pdf"outformat="pdf"storage="internal"name="test_file.pdf"folder=""savepath=""savefile="summarized.pdf"summarizer=SummarizeDocument(language,_format,outformat,storage,name,folder,savepath,savefile)request=summarizer.to_string()output=api.post_summarize_document(request)print(output.message)Other SDKs for GroupDocs.Rewriter CloudGroupDocs also offers native SDK packages for other popular programming languages:.NETNuGetGitHubProduct Page|Docs|Demos|Swagger UI|Examples|Blog|Search|Free Support|Free Trial