DataSourceInfo class

DataSourceInfo class

Provides information on a single data source object to be used to assemble a document from a template.

The DataSourceInfo type exposes the following members:

Constructors

Constructor Description
init Initializes a new DataSourceInfo instance with no properties set.
init Initializes a new instance of this class with the specified data source object.
init Initializes a new instance of this class with the data source object and its name specified.

Properties

Property Description
data_source The data source object.
name The name of the data source object used to access it in a template document.

Example

from groupdocs.assembly import DataSourceInfo, DocumentAssembler

# A dict, under the name the template's tags use for it: <<[customer.Name]>>
customer = {"Name": "Quayside Bistro", "Product": "Harbor Blend whole bean coffee"}

assembler = DocumentAssembler()
assembler.assemble_document("hello-world.docx", "hello-world-report.docx", DataSourceInfo(customer, "customer"))

Guides

Task guides that use DataSourceInfo:

See Also