OpenClip XML Media Management Python Module 0.0.12
Openclip is a python abstraction of the openclip XML media classification format. It provides ORM-style access to “dotclip” data (file or generated) to make the life of a python developer much easier. This module is not meant to be a complete solution but rather a stable and standardized component of various other scripts, tools, guis, and software integrations.
the following is adapted from the Autodesk documentation of the Gateway Clip specification…
The “.clip“ OpenClip XML format is an XML wrapper which points to single or multiple video and/or audio sources and wraps them in a single entity. The XML is built to reflect the structure of a complex clip, with the most atomic portions (paths to media) at the bottom of the hierarchy, and the clip at the top most entity.
An OpenClip XML structured file describes at least the following information:
The following is a basic representation of the structure of an Open Clip:
Within a clip, you have tracks, within tracks you have feeds and within feeds, spans.
This should be easy. You may need administrator priveleges depending on your system configuration.
Note: Some software have their own isolated python environment for a good reason - try at your own risk to integrate this library…
For the latest dev branch:
git clone https://github.com/robmoggach/python-openclip.git cd python-openclip python setup.py install
or for the latest (possibly stable?) release:
pip install openclip
easy_install openclip **Note:** I prefer markdown for documentation but setuptools prefers restructuredText. For this reason the ``setup.py`` file **optionally** requires package ``pypandoc`` which can be installed using ``pip install pypandoc``.
lxml.etree has been used in development for this project but it does have fallbacks for system xml element tree tools. It’s faster and produces cleaner xml so it’s preferable but not implicitly required. If you don’t want it, remove it from the setup.py file and you’ll be good to go.
The documentation (non-existent) provides more on this but essentially you create an OpenClip object / class instance and that object has a number of built in methods for manipulating the data within.
Here’s an example that creates a generic clip object. (no file specified)
>>> import openclip >>> oc = openclip.OpenClip() >>> oc.clip <openclip.elements.Clip object at 0x102529c90> >>> print oc.clip.xml <clip type="clip" version="3"><name type="string">OpenClip_20160108_120119_93</name></clip> >>> oc.clip.tracks <openclip.elements.Tracks object at 0x10252e910> >>> oc.clip.versions <openclip.elements.Versions object at 0x10252e950> >>> oc.clip.tracks.track_list  >>> oc.clip.versions.version_list 
The following are my own requirements for this module, in no particular order. Some have already been satisfied.
I use tox for testing and Travis CI (a distributed continuous integration service used to build and test projects hosted at GitHub).
Running the tests should be as easy as typing:
(assuming you have tox and pytest installed of course.)
python-openclip uses a number of opensource packages.
Copyright (c) 2016 Robert Moggach
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.