A lightly opinionated DaVinci Resolve Python API wrapper
Provides auto completion, type hints and great API reference documentation.
I really just wanted auto completion in the IDE and to program transcoding RAW formats
Note This branch is for Resolve 18 only and is still in development. Checkout the
mainbranch if you are using Resolve 17
- PyDavinci requires Python 3.10 or higher
- External scripting with PyDavinci requires Resolve Studio 18 (Free version does not allow API access)
- There is currently no release version for the Resolve 18 branch. Install it with git.
pip install git+https://github.com/pedrolabonia/pydavinci@resolve_18Now, with Davinci Resolve open, we just need to import it!
from pydavinci import davinci
resolve = davinci.Resolve()- Check out the usage examples
- Or go deep in the documentation
For launching scripts externally, you also need the Studio version.
If you're working with the built-in Davinci Resolve Python console, you need to install pydavinci for the Python interpreter that's used by Davinci's console.
For avoiding conflicts when using inside the embedded console, don't use resolve as the entry point variable, as that's reserved by the console. Example of suggested usage:
For pydavinci to work by launching scripts outside the embedded console, make sure external scripting is set to Local in Settings -> System -> General
Contributors are always welcome! I currently have a few things I want to change, some of them are:
-
Document all possible values ofNew in 0.2.0!get_settingandset_setting -
Add a better way of interfacing with the wholeNew in 0.2.0!get_settingandset_settingmethods using a proxy class or something to that effect -
Deal with markers in a better wayNew in 0.2.0! - Auto launch Resolve when it's not open - I've ran into some issues while trying to connect to the C extension right after launching it, a dirty way to do it is to just implement a
time.sleepbefore trying to import the fusionscript module, otherwise we'll need to create another entrypoint to the api for launching the process and then signaling when it's ready - Do the same wrapper made for settings to Metadata and Properties
Up to date docs are still a work in progress. At some point expect to see the original API reference extended and some further examples included. For now go to the original PyDavinci project
Here's a quick list of changes and added API support not present in the original docs:
- Python 3.10 typing
- Using Hatch for project management
- Using Ruff for linting
- Added Gallery API wrapper (untested)
- Added timeline.settings.timecode setter
- Support Resolve's GetUniqueID method