Pymiere logo Pymiere : Python for Premiere Pro

Use Python to interact with Adobe Premiere Pro. Gather data, check and edit your projects.

Why using Pymiere?

Pymiere comes from a consideration, has a Pipeline TD in a 3D/VFX studio, that we add no easy/good way to plug Premiere Pro into our workflow.
Of course, if you want to programmatically create a Premiere file, you can simply use an XML file (see Open Timeline IO to XML). But that require exporting and importing files, potentially loosing some data and no quick visual feedback.

That's where pymiere comes in handy:
Want to check if some shots have new versions available? Maybe automatically place them on a new track?
Want to create interactive tools for your editor using Qt, Shotgun API, custom libs...?

Installation

  1. Install the Pymiere Link extension for Premiere Pro

  2. Install the Python lib

    • make sure the requests Python lib is installed (pip install requests)
    • put the pymiere folder somewhere accessible to your Python
  3. Try running some basic code:

    import pymiere
    print(pymiere.objects.app.isDocumentOpen())

Documentation

Quick start

Open or create a Premiere project containing a sequence with at least a clip. You can now execute the demo.py which will demonstrate some basic code. You can also look into the pymiere/wrappers.py file to see some more code example.

Pymiere is at its core a wrapper for Adobe ExtendScript (Adobe flavored javascript for manipulating data in their software).
Most of the help for ExtendScript will therefore apply to pymiere.
pymiere.objects is your Python entry point to access all Premiere objects and functions. As pymiere offer code completion and type hint in modern IDE, it is easy to navigate/use the objects. Some also have docstrings.
Note: You have to have Premiere Pro running for pymiere to work. If your script needs to know if Premiere Pro is running or start it, some functions are available in pymiere/exe_utils.py for that.

Useful links

Versions

Contact

For any support, questions or interest please contact me: q.masingarbe@gmail.com

Internal working

Here is how pymiere works:

  1. pymiere converts the python action (getting a property, executing a function...) to ExtendScript code (ExtendScript is Abode flavored javascript used to access and manipulate programmatically their software)
  2. pymiere sends the ExtendScript code to the Pymiere Link extension via the requests lib (http)
  3. Pymiere Link node.js server receive the ExtendScript code and execute it within Premiere Pro context
  4. If some value is returned Pymiere Link will send it back as a JSON encoded response to pymiere
  5. pymiere will then decode the JSON data to have it back in the python context

On top of that, the lib also include a mirror of all Premiere Pro ExtendScript objects in Python so that modern IDE are able to autocomplete and add hint while coding. These objects mirrors were autogenerated from the Extendscript objects reflection interface. I did a detailed article about this workflow !

Futur improvements