GroupDocs.Assembly for Python via .NET generates reports from templates. A template is an ordinary document of one of the supported formats whose text holds tags such as <<[customer.Name]>> or <<foreach [o in orders]>>. Every task follows the same workflow: prepare the data, wrap each data source in a DataSourceInfo with the name the template uses, and call DocumentAssembler.assemble_document() with the template and the report to write.
Data sources
Fill a template with:
Python data: dicts, lists, numbers, strings, dates and Decimal values, as they are. A dict’s keys are read as members (customer.Name), a list is a collection to iterate. See Generate from custom objects and The Business Layer.
Expressions in tags use a subset of C# syntax that works on any data source: arithmetic, comparisons, string operations, the Sum, Count, Average, Where, OrderBy, GroupBy and other sequence operations, and conditional expressions. Format numbers, dates and text in the tag itself, declare variables, and leave comments in a template. See Template syntax - part 1, part 2, Basic template syntax and Enumeration extension methods.
Email messages: MSG and EML templates whose sender, recipients, subject and body come from the data. See Generate email messages.
Formats
Templates and reports can be Word processing documents, spreadsheets, presentations, OpenDocument files, emails, HTML, Markdown and plain text. A report is saved in the format of its file extension, or of the format you name with LoadSaveOptions, so a Word template can give a PDF or HTML report. See Supported document formats, Changing target file format and Using Markdown documents.