GroupDocs.Assembly for Python via .NET Overview
Leave feedback
On this page
What is GroupDocs.Assembly?
GroupDocs.Assembly for Python via .NET is a native Python library for document automation: it builds reports and documents from templates. A template is an ordinary Word, Excel, PowerPoint, OpenDocument, email, HTML, Markdown or text document in which tags such as <<[customer.Name]>> and <<foreach [o in orders]>> mark where the data goes. GroupDocs.Assembly fills the tags with your data - Python dicts and lists, JSON, XML and CSV files, or the tables of other documents - and saves the report in the template’s format or another one, such as PDF. No Microsoft Office installation is required.
Typical uses include:
Business documents - invoices, contracts, offers and letters from one template per document type.
Reports - tables, lists and charts of sales, orders or any other data, with totals, grouping, filtering and sorting done in the template.
Email - messages whose recipients, subject and body come from data.
Mail merge - one document per customer, employee or record.
Key Capabilities
Capability
Description
Python data
Dicts and lists as they are, with their types: numbers, strings, dates, Decimal, nested dicts and lists.
No cloud calls, no Microsoft Office install, no network traffic.
Quick Example
Fill a Word template with the orders of a customer from a JSON file, and save the report as PDF:
importjsonfromgroupdocs.assemblyimportDataSourceInfo,DocumentAssemblerdefquick_example():# The data: one customer and its orders, read from JSON into a dictwithopen("customer.json",encoding="utf-8")asf:customer=json.load(f)# Fill the template's tags and save the report as PDFassembler=DocumentAssembler()assembler.assemble_document("customer-summary.docx","customer-summary.pdf",DataSourceInfo(customer,"customer"))print("Orders in the report:",len(customer["Order"]))if__name__=="__main__":quick_example()