Compound File
The CompoundFile
object represents the in memory representation of a Diffgram Compound File. This is a file that may contain 1 or more child files with different media types and configuration.
Most of the methods within the compound file object just modify the object in-memory. That means that no changes are actually stored on diffgram until you call either the upload()
method for a new compound file. or the update_all()
method for an existing compound file.
Adding/Removing Files on an already uploaded compound file is not yet supported.
Once you call the
upload()
method for a new compound file. You cannot modify the number of childs withing that compound file. However you can still modify the ordinal and other metadata of the compound or child files and then callupdate_all()
to persist this changes on the Diffgram Platform.New versions of the SDK and Diffgram Core will support adding and removing files soon.
Constructor
compund_file = CompoundFile(project = project, name = 'myCompoundFile', directory_id = 25)
- project:object The
Project
object from the SDK where the compound file should be uploaded. - name:str The name of the compound file. Must be unique withing the directory.
- directory_id:int The directory ID where the compound file and all of its children will be uploaded.
Attributes
- project:object The
Project
object where the compound file lives. - child_files_to_upload: List[CompoundChildFile] The list of child files, that will be uploaded or updated when calling either
upload()
orupdate_all()
if the files are being updated.
Methods
- from_dict
- update_all
- remove_child_file
- add_child_from_local
- add_child_file_from_url
- add_child_from_blob_path
- upload
Updated almost 2 years ago