opentimelineio.url_utils¶
Utilities for conversion between urls and file paths
- opentimelineio.url_utils.filepath_from_url(urlstr)¶
Take an url and return a filepath.
URLs can either be encoded according to the RFC 3986 standard or not. Additionally, Windows mapped drive letter and UNC paths need to be accounted for when processing URL(s); however, there are ongoing discussions about how to best handle this within Python developer community. This function is meant to cover these scenarios in the interim.
- opentimelineio.url_utils.url_from_filepath(fpath)¶
Convert a filesystem path to an url in a portable way.
- ensures that fpath conforms to the following pattern:
if it is an absolute path, “file:///path/to/thing”
if it is a relative path, “path/to/thing”
- In other words, if you pass in:
“/var/tmp/thing.otio” -> “file:///var/tmp/thing.otio”
“subdir/thing.otio” -> “tmp/thing.otio”