Resource references¶
Refer to the data that media, image fills, and image bullets use.
Resource¶
-
class creator_studio_doc_format.core.Resource(*, preset_identifier=
'', base64_encoded=None, indirect=None, **extra_data)[source]¶ The data used for image, movie, and audio media, and for image fills and image bullets.
Resources can be carried inline (
base64_encoded), which makes the JSON self-contained, or refer to files stored alongside the JSON in the archive (indirect), which keeps large assets out of the JSON but can be read only when those files are present. What happens when bytes can’t be read (anindirectname that matches no file, or abase64_encodedstring that isn’t valid Base64) depends on where the resource is used. An image, movie, or audio object whose media can’t be read is dropped with a warning, though aMovie.poster_imagethat can’t be read doesn’t drop the movie. Such an object placed inline in the text of a text box or shape removes the whole text box or shape, including all of its text, and so does an image bullet in that text. An image fill in aSlideLayout.backgroundremoves that whole layout, and one anywhere else is left out. An image bullet or such an object in a slide’s presenter notes (Slide.note), or an image bullet in a list style inPresentation.stylesheet, stops the document from loading.-
field base64_encoded : Base64EncodedResource | None =
None¶ Data carried inline in the resource.
-
field indirect : IndirectResource | None =
None¶ Data stored in a separate file, identified by name rather than carried in the resource.
-
field base64_encoded : Base64EncodedResource | None =
IndirectResource¶
-
class creator_studio_doc_format.core.IndirectResource(*, preset_identifier=
'', identifier=None, filename, premium_resource_info=None, **extra_data)[source]¶ A resource whose bytes are stored in a separate file rather than in the JSON.
In a
.keyxfile, theidentifiernames a file in the archive’sDatadirectory. A name the reader can’t resolve is an error rather than an empty asset; what happens then depends on where the resource is used (seeResource).-
field identifier : str | None =
None¶ The name of the file inside the archive’s
Datadirectory that contains the data for this resource. If missing,filenameis used as the identifier. When no data can be found for it, the resource can’t be loaded (seeResourcefor what happens then).
- field filename : str [Required]¶
The filename shown for the resource, including its filename extension, in the user interface. This value need not match
identifier; seeidentifierfor what happens when that’s absent. The extension is significant: it’s preserved when the resource is stored.
Additional metadata for premium resources from the Content Hub.
-
field identifier : str | None =
Base64EncodedResource¶
-
class creator_studio_doc_format.core.Base64EncodedResource(*, preset_identifier=
'', string, filename, premium_resource_info=None, **extra_data)[source]¶ A resource whose bytes are carried as Base64 in the resource itself, so the JSON needs no companion files.
If
stringdoesn’t decode, what happens depends on where the resource is used (seeResource).- field string : str [Required]¶
The resource’s bytes as a Base64-encoded string. If the string can’t be decoded, reading fails.
- field filename : str [Required]¶
The filename shown for the resource, including its filename extension, in the user interface. It becomes the name of the resource decoded from
string.
Additional metadata for premium resources from the Content Hub.
PremiumResourceInfo¶
-
class creator_studio_doc_format.core.PremiumResourceInfo(*, preset_identifier=
'', asset_uuid, is_derived_asset, may_need_watermark, **extra_data)[source]¶ Additional metadata that marks a resource as premium content that the reader originally sourced from the content hub.
It carries the watermarking terms attached to the resource.
- field asset_uuid : str [Required]¶
The UUID of the premium resource’s asset in the media library, written as a standard UUID string. If the value isn’t a valid UUID, it’s ignored, and the resource then loses its media library association and its watermark information.
- field is_derived_asset : bool [Required]¶
Whether the resource was edited or otherwise derived from its original Content Hub data; if
false, it’s the unmodified original.
- field may_need_watermark : bool [Required]¶
Whether the resource may be shown with a watermark for customers without an active subscription. When the document is read, the resource is treated as newly added, so such a customer can see a watermark on media that the original presentation showed without one.