aaf.storage

File

class aaf.storage.File(path, mode = 'r')

Bases: aaf.base.AAFBase

AAF File Object. This is the entry point object for most of the API. It is recommended to create this object with the aaf.open alias. Creating this object is designed to be like python’s native open function.

For example. Opening existing AAF file readonly:

f = aaf.open("/path/to/aaf_file.aaf", 'r')

Opening new AAF file overwriting existing one:

f = aaf.open("/path/to/aaf_file.aaf", 'w')

Opening existing AAF in read and write:

f = aaf.open("/path/to/aaf_file.aaf", 'rw')

Opening New Transient in memory file:

f = aaf.open()
or
f = aaf.open(None, 't')

Note

Opening AAF formatted xml files is untested

__init__(path, mode = 'r')
Parameters:
  • path (str) – AAF file path, set to None if in opening in transient mode.
  • mode (str) – Similar to python’s native open function modes.

modes:

  • "r" readonly
  • "w" write
  • "rw" readonly or modify
  • "t" transient in memory file
close()

Close the file. A closed file cannot be read or written any more.

create

AAFObject Factory property. Used for creating new AAFObjects.

example:

# create a empty aaf file.
f = aaf.open("/path/to/new_aaf_file.aaf", "w")

# use create factory to make a MasterMob.
mob = f.create.MasterMob()

# add MasterMob object to file.
f.storage.add_mob(mob)
dictionary

aaf.dictionary.Dictionary for AAF file. The dictionary property has DefinitionObject objects.

header

Header object for AAF file.

save(path = None)

Save AAF file to disk. If path is None and the mode is "rw" or "w" it will overwrite or modify the current file. If path is supplied, a new file will be created, (Save Copy As). If the extension of the path is ".xml" a xml file will be saved.

Parameters:path (str or None) – optional path to new aaf file.

Note

If file mode is "t" or "r" and path is None, nothing will happen

storage

ContentStorage object for AAF File. This has the Mob and EssenceData objects.

ContentStorage

class aaf.storage.ContentStorage

Bases: aaf.base.AAFObject

This object has all Mobs and Essence Data in the file

add_essence_data()
add_mob(mob)

Add a aaf.mob.Mob object to ContentStorage

Parameters:mob (aaf.mob.Mob) – Mob object to add.
composition_mobs()

Returns a aaf.iterator.MobIter that iterates over all aaf.mob.CompositionMob objects in the AAF file.

Returns:aaf.iterator.MobIter
count_mobs()

Total number of mobs in AAF File

Returns:int
essence_data()

Returns a aaf.iterator.EssenceDataIter that iterates over all embedded aaf.essence.EssenceData in AAF file.

Returns:aaf.iterator.EssenceDataIter
lookup_mob(mobID)

Looks up the Mob that matches the given mob id.

Parameters:mobID (aaf.util.MobID or str) – 9d of aaf.mob.Mob to lookup.
Returns:aaf.mob.Mob
master_mobs()

Returns a aaf.iterator.MobIter that iterates over all aaf.mob.MasterMob objects in the AAF file.

Returns:aaf.iterator.MobIter
mobs()

Returns a aaf.iterator.MobIter` that iterates over all aaf.mob.Mob objects in the AAF file.

Returns:aaf.iterator.MobIter
remove_essence_data()
remove_mob(mob)

Remove a aaf.mob.Mob object from ContentStorage.

Parameters:mob (aaf.mob.Mob) – Mob object to remove.
toplevel_mobs()

Returns a aaf.iterator.MobIter that iterates over all aaf.mob.CompositionMob objects in the AAF file with "UsageType"" property set to "Usage_TopLevel".

Returns:aaf.iterator.MobIter

Table Of Contents

Previous topic

Welcome to pyaaf’s documentation!

Next topic

aaf.mob

This Page