opentimelineio.adapters

Expose the adapter interface to developers.

To read from an existing representation, use the read_from_string and read_from_file functions. To query the list of adapters, use the available_adapter_names function.

The otio_json adapter is provided as a the canonical, lossless, serialization of the in-memory otio schema. Other adapters are to varying degrees lossy. For more information, consult the documentation in the individual adapter modules.

class opentimelineio.adapters.Adapter None

Adapters convert between OTIO and other formats.

Note that this class is not subclassed by adapters. Rather, an adapter is a python module that implements at least one of the following functions:

write_to_string(input_otio)
write_to_file(input_otio, filepath) (optionally inferred)
read_from_string(input_str)
read_from_file(filepath) (optionally inferred)

…as well as a small json file that advertises the features of the adapter to OTIO. This class serves as the wrapper around these modules internal to OTIO. You should not need to extend this class to create new adapters for OTIO.

For more information: https://opentimelineio.readthedocs.io/en/latest/tutorials/write-an-adapter.html. # noqa

has_feature(feature_string)

return true if adapter supports feature_string, which must be a key of the _FEATURE_MAP dictionary.

Will trigger a call to PythonPlugin.module(), which imports the plugin.

plugin_info_map()

Adds extra adapter-specific information to call to the parent fn.

read_from_file(filepath, media_linker_name='__default', media_linker_argument_map=None, hook_function_argument_map=None, **adapter_argument_map)

Execute the read_from_file function on this adapter.

If read_from_string exists, but not read_from_file, execute that with a trivial file object wrapper.

read_from_string(input_str, media_linker_name='__default', media_linker_argument_map=None, hook_function_argument_map=None, **adapter_argument_map)

Call the read_from_string function on this adapter.

property suffixes

File suffixes associated with this adapter.

write_to_file(input_otio, filepath, hook_function_argument_map=None, **adapter_argument_map)

Execute the write_to_file function on this adapter.

If write_to_string exists, but not write_to_file, execute that with a trivial file object wrapper.

write_to_string(input_otio, hook_function_argument_map=None, **adapter_argument_map)

Call the write_to_string function on this adapter.

opentimelineio.adapters.available_adapter_names()

Return a string list of the available adapters.

opentimelineio.adapters.from_filepath(filepath)

Guess the adapter object to use for a given filepath.

For example, foo.otio returns the otio_json adapter.

opentimelineio.adapters.from_name(name)

Fetch the adapter object by the name of the adapter directly.

opentimelineio.adapters.read_from_file(filepath, adapter_name=None, media_linker_name='__default', media_linker_argument_map=None, **adapter_argument_map)

Read filepath using adapter_name.

If adapter_name is None, try and infer the adapter name from the filepath.

Example
 timeline = read_from_file("example_trailer.otio")
 timeline = read_from_file("file_with_no_extension", "cmx_3600")
opentimelineio.adapters.read_from_string(input_str, adapter_name='otio_json', media_linker_name='__default', media_linker_argument_map=None, **adapter_argument_map)

Read a timeline from input_str using adapter_name.

This is useful if you obtain a timeline from someplace other than the filesystem.

Example
 raw_text = urlopen(my_url).read()
 timeline = read_from_string(raw_text, "otio_json")
opentimelineio.adapters.suffixes_with_defined_adapters(read=False, write=False)

Return a set of all the suffixes that have adapters defined for them.

opentimelineio.adapters.write_to_file(input_otio, filepath, adapter_name=None, **adapter_argument_map)

Write input_otio to filepath using adapter_name.

If adapter_name is None, infer the adapter_name to use based on the filepath.

Example
 otio.adapters.write_to_file(my_timeline, "output.otio")
opentimelineio.adapters.write_to_string(input_otio, adapter_name='otio_json', **adapter_argument_map)

Return input_otio written to a string using adapter_name.

Example
 raw_text = otio.adapters.write_to_string(my_timeline, "otio_json")

Modules

opentimelineio.adapters.adapter

Implementation of the OTIO internal Adapter system.

opentimelineio.adapters.cmx_3600

OpenTimelineIO CMX 3600 EDL Adapter

opentimelineio.adapters.fcp_xml

OpenTimelineIO Final Cut Pro 7 XML Adapter.

opentimelineio.adapters.file_bundle_utils

Common utilities used by the file bundle adapters (otiod and otioz).

opentimelineio.adapters.otio_json

Adapter for reading and writing native .otio json files.

opentimelineio.adapters.otiod

OTIOD adapter - bundles otio files linked to local media in a directory

opentimelineio.adapters.otioz

OTIOZ adapter - bundles otio files linked to local media

opentimelineio.adapters.svg

OTIO to SVG Adapter Points in calculations are y-up.