imagecollection
dsstools.imagecollection
Module for handling the batch export of ImageGenerators.
ImageCollection(iterable=None)
Bases: list
Class for exporting multiple ImageGenerators in one go.
append(item)
Add new ImageGenerator to ImageCollection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item
|
ImageGenerator
|
Item to append to list. |
required |
Returns:
create_flipbook(path, **kwargs)
"Creates a flipbook as PPTX or PDF depending on file ending.
For the specific valid keyword arguments see create_flipbook_pdf
or
create_flipbook_pptx
which this a wrapper for.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Path | str
|
Path to save flipbook to. File ending decides on the internal file format. |
required |
Returns:
Type | Description |
---|---|
Either a PDF or PPTX object. |
create_flipbook_pdf(path)
Create PDF containing all ImageGenerators.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Path | str
|
Path to save PDF to. |
required |
Returns:
Type | Description |
---|---|
PdfPages
|
Generated PDF object. |
create_flipbook_pptx(path, titles=None, left=Cm(4), top=Cm(-5.3), height=Cm(25))
Create PPTX containing all ImageGenerators.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Path | str
|
Path to save file to. |
required |
titles
|
Optional[list]
|
Titles to give each slide. (Default value = None) |
None
|
left
|
Length
|
Left offset of the image on the slide, starting from upper left. (Default value = Cm(4)) |
Cm(4)
|
top
|
Length
|
Top offset of the image on the slide, starting from upper left. (Default value = Cm(-5.3)) |
Cm(-5.3)
|
height
|
Length
|
Height of the image. By default uses a sensible default. If you change this, you might have to adapt the left and top arguments as well. (Default value = Cm(25)) |
Cm(25)
|
Returns:
Type | Description |
---|---|
Presentation
|
Generated PPTX object. |
extend(other)
Extend existing ImageCollection with another one.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
Iterable[ImageGenerator]
|
Another ImageCollection to extend with. |
required |
Returns:
insert(id, item)
Insert an item at a specific spot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
Spot to insert at. |
required | |
item
|
ImageGenerator
|
The item to insert. |
required |
Returns:
Type | Description |
---|---|
The updated ImageCollection. |