Report Generator for Python

Python library to build highly customized reports using REST API

  • GroupDocs.Assembly Cloud for cURL
  • GroupDocs.Assembly Cloud SDK for .NET
  • GroupDocs.Assembly Cloud SDK for Java
  • GroupDocs.Assembly Cloud SDK for C++
  • GroupDocs.Assembly Cloud SDK for Go
  • GroupDocs.Assembly Cloud SDK for PHP
  • GroupDocs.Assembly Cloud SDK for Ruby
  • GroupDocs.Assembly Cloud SDK for Python
  • GroupDocs.Assembly Cloud SDK for Node.js
  • GroupDocs.Assembly Cloud SDK for Swift
Start Free Trial

GroupDocs.Assembly Cloud SDK for Python enables developers to automate the creation of richly formatted documents such as contracts, invoices, shipment reports, sales proposals, inventories and many other business‑critical artifacts. The solution is completely cloud‑based and accessed through a REST API, which means any Python application capable of sending HTTP requests can generate documents on‑demand without installing server‑side software or third‑party tools.

At its core the platform works with document templates that contain special placeholder fields and programming constructs. These placeholders are automatically replaced with values taken from a data source (XML or JSON) using a LINQ‑style expression syntax. This powerful approach allows you to embed images, charts, barcodes, set background colors for HTML output, create dynamic tables and lists from array data, and apply conditional logic to include or exclude sections of the document. Because the SDK supports a wide range of input and output formats, you can generate a PDF from a DOCX template, produce HTML reports, or output OpenDocument files without additional conversion steps.

The typical workflow in Python consists of three straightforward steps:

1️⃣ Create a template – design a Word, Excel, PowerPoint or any supported Office/OpenOffice file and insert placeholder fields and generation rules.

2️⃣ Prepare a data source – provide your data in XML or JSON format, matching the placeholders defined in the template.

3️⃣ Write a few lines of Python code – use the groupdocsassemblycloud package to upload the template to GroupDocs Cloud Storage, pass the data source together with the desired output format, and invoke the AssembleDocument operation. The API returns the assembled document directly in the response or stores it in the Cloud for later retrieval.

All interactions are secured with SSL/TLS encryption, and authentication is performed via your personal App SID and App Key. This ensures that your documents and data remain protected while being processed in the cloud. The SDK’s cross‑platform nature lets you integrate document generation into web services, batch jobs, desktop applications, or serverless functions, delivering printable, web‑ready or email‑ready documents instantly and reliably.

Document Assembly REST API Features

Template processing with placeholder fields

Data binding from XML or JSON sources

LINQ‑style expression syntax for conditional logic

Mail‑merge for batch personalized letters

Image, chart and barcode insertion

Dynamic tables and lists from array data

Hyperlink and bookmark support

Formula calculations for spreadsheets

Background colors for HTML output

SSL/TLS encryption and API‑key authentication

Generate a document in Python

This Python example demonstrates how to upload a template, bind a data file and generate an output document using the GroupDocs Assembly Cloud SDK.

Steps

  1. Initialize the AssemblyApi with your App SID and App Key.
  2. Upload the template file to Cloud Storage.
  3. Open the data source file.
  4. Create TemplateFileInfo and AssembleOptions.
  5. Call assemble_document to generate the result.
import groupdocsassemblycloud

# Initialize API client (replace with your credentials)
assembly_api = groupdocsassemblycloud.AssemblyApi('####################', '####################')

# 1️⃣ Upload the template
file_name = 'Input1.docx'
with open(file_name, 'rb') as request_file_content:
    upload_request = groupdocsassemblycloud.models.requests.UploadFileRequest(
        file_content=request_file_content,
        path=file_name
    )
    assembly_api.upload_file(upload_request)

# 2️⃣ Load data source (could be XML, JSON or DOCX)
data_file = 'Input2.docx'
with open(data_file, 'rb') as data:
    template_info = groupdocsassemblycloud.models.TemplateFileInfo(file_name)

    # 3️⃣ Set assemble options (output format: docx)
    assemble_options = groupdocsassemblycloud.models.AssembleOptions(
        template_info,
        "docx",
        data
    )

    # 4️⃣ Assemble the document
    request = groupdocsassemblycloud.models.requests.AssembleDocumentRequest(assemble_options)
    result = assembly_api.assemble_document(request)

    print("Document generated successfully:", result.path)

Support and Learning Resources

GroupDocs.Assembly Cloud also offers SDKs for other languages as listed below:

  English
5f5c5ef