Assets#

class frameioclient.Asset(client)#
add_version(target_asset_id, new_version_id)#

Add a new version to a version stack, or create a new one!

Parameters:
  • target_asset_id (Union[str, UUID]) – The main/destination Asset or Version Stack.

  • new_version_id (Union[str, UUID]) – The id for the asset you want to add to the Version Stack or create a new one with.

Example:

client.add_version_to_asset(
  destination_id="123",
  next_asset_id="234"
)
bulk_copy(destination_folder_id, asset_list=[], copy_comments=False)#

Bulk copy assets

Parameters:
  • destination_folder_id (Union[str, UUID]) – The id of the folder you want to copy into.

  • asset_list (Optional[List]) – A list of the asset IDs you want to copy.

  • copy_comments (Optional[bool]) – Whether or not to copy comments: True or False.

Example:

client.assets.bulk_copy(
  "adeffee123342",
  asset_list=[
    "7ee008c5-49a2-f8b5-997d-8b64de153c30",
    "7ee008c5-49a2-f8b5-997d-8b64de153c30"
  ],
  copy_comments=True
)
copy(destination_folder_id, target_asset_id)#

Copy an asset

Parameters:
  • destination_folder_id (Union[str, UUID]) – The id of the folder you want to copy into.

  • target_asset_id (Union[str, UUID]) – The id of the asset you want to copy.

Example:

client.assets.copy("adeffee123342", id="7ee008c5-49a2-f8b5-997d-8b64de153c30")
create(parent_asset_id, name, type='file', filetype=None, filesize=None)#

Create an asset.

Parameters:
  • parent_asset_id (Union[str, UUID]) – The parent asset id

  • name (str) – The asset’s display name

  • type (Optional[str]) – The type of asset (‘file’, ‘folder’)

  • filesize (Optional[int]) – The size of the asset in bytes

  • filetype (Optional[str]) – The MIME-type of the asset

Example:

client.assets.create(
  parent_asset_id="123abc",
  name="ExampleFile.mp4",
  type="file",
  filetype="video/mp4",
  filesize=123456
)
create_folder(parent_asset_id, name='New Folder')#

Create a new folder.

Parameters:
  • parent_asset_id (str) – The parent asset id.

  • name (str) – The name of the new folder.

Example:

client.assets.create_folder(
  parent_asset_id="123abc",
  name="ExampleFile.mp4",
)
delete(asset_id)#

Delete an asset

Parameters:

asset_id (Union[str, UUID]) – the asset’s id

download(asset, download_folder, prefix=None, multi_part=None, replace=False)#

Download an asset. The method will exit once the file is downloaded.

Parameters:
  • asset (Dict) – The asset object.

  • download_folder (str) – The location to download the file to.

  • multi_part (Optional[bool]) – Attempt to do a multi-part download (non-WMID assets).

  • replace (Optional[bool]) – Whether or not you want to replace a file if one is found at the destination path.

Example:

client.assets.download(asset, "~./Downloads")
from_url(parent_asset_id, name, url)#

Create an asset from a URL.

Parameters:
  • parent_asset_id (Union[str, UUID]) – The parent asset id.

  • name (str) – The filename.

  • url (str) – The remote URL.

Example:

client.assets.from_url(
  parent_asset_id="123abc",
  name="ExampleFile.mp4",
  type="file",
  url="https://"
)
get(asset_id)#

Get an asset by id.

Parameters:

asset_id (Union[str, UUID]) – The asset id.

Example:

client.assets.get(
  asset_id='1231-12414-afasfaf-aklsajflaksjfla',
)
get_children(asset_id, includes=[], slim=False, **kwargs)#

Get a folder.

Parameters:

asset_id (Union[str, UUID]) – The asset id.

Keyword Arguments:

includes (list): List of includes you would like to add.

Example:

client.assets.get_children(
  asset_id='1231-12414-afasfaf-aklsajflaksjfla',
  include=['review_links','cover_asset','creator','presentation']
)
update(asset_id, **kwargs)#

Updates an asset

Parameters:

asset_id (Union[str, UUID]) – The asset’s id

Keyword Arguments:

the fields to update

Example:

client.assets.update("adeffee123342", name="updated_filename.mp4")
upload(destination_id, filepath, asset=None)#

Upload a file. The method will exit once the file is uploaded.

Parameters:
  • destination_id (Union[str, UUID]) – The destination Project or Folder ID.

  • filepath (str) – The location of the file on your local filesystem that you want to upload.

Example:

client.assets.upload('1231-12414-afasfaf-aklsajflaksjfla', "./file.mov")
upload_folder(source_path, destination_id)#

Upload a folder full of assets, maintaining hierarchy. The method will exit once the file is uploaded.

Parameters:
  • filepath – The location of the folder on your disk.

  • destination_id (Union[str, UUID]) – The destination Project or Folder ID.

Example:

client.assets.upload("./file.mov", "1231-12414-afasfaf-aklsajflaksjfla")