This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PyBMD is a Python wrapper library for DaVinci Resolve's API, providing programmatic control over DaVinci Resolve video editing software. The library supports both Windows and macOS platforms and offers comprehensive access to DaVinci Resolve's functionality including project management, media handling, timeline operations, and rendering.
- Build System: Uses
pyproject.tomlwithhatchlingas build backend - Dependency Manager: Uses
uvfor package management (seeuv.lock) - Install Package:
uv syncto install dependencies and the package in editable mode - Python Requirement: Python 3.12+
- Build Documentation: From the
docs/directory, runmake html(uses Sphinx) - Documentation Dependencies: Install with
uv sync --extra docs(includes Sphinx, pydata-sphinx-theme)
psutil- Process management for auto-starting DaVinci Resolvedftt-timecode- Timecode handlingmultimethod- Multiple dispatch supportpydantic>=2.12.5- Data validation and settings management
The library follows a modular design mirroring DaVinci Resolve's object hierarchy:
Main Entry Point:
resolve.py: TheResolveclass is the main entry point for all DaVinci Resolve operationsResolve(resolve_ip="127.0.0.1", auto_start=False): Key initialization parametersresolve_ip: IP address for remote DaVinci Resolve instances (default: "127.0.0.1" for local)auto_start: Automatically launch DaVinci Resolve if not running (default: False)
_init_bmd.py: Handles dynamic loading of DaVinci Resolve's fusionscript library
Core Components:
project_manager.py: Project and database managementproject.py: Individual project operations and settingsmedia_pool.py&media_pool_item.py: Media management and clip propertiesmedia_storage.py: File system and storage operationstimeline.py&timeline_item.py: Timeline and clip editing operationsfolder.py: Media bin/folder organization
Specialized Modules:
gallery.py,gallery_still.py,gallery_still_album.py: Still image managementfusion.py,fusion_comp.py: Fusion compositor integrationui_dispather.py,ui_manager.py: GUI creation and managementtoolkits.py: High-level utility functions (includesStillManagerfor marker-based still export)settings.py: Configuration objects and enumscolor_group.py,graph.py: Color grading and node graph operations
- Wrapper Pattern: Each Python class wraps the corresponding DaVinci Resolve API object
- Initialization Chain:
Resolve()→ loads fusionscript → initializes all other components - Auto-start Feature: Optional automatic launching of DaVinci Resolve if not running
- Cross-platform Support: Dynamic library loading for Windows/macOS/Linux
The project dynamically loads DaVinci Resolve's fusionscript library from:
- macOS:
/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so - Windows:
C:\Program Files\Blackmagic Design\DaVinci Resolve\fusionscript.dll - Linux:
/opt/resolve/Developer/Scripting/Modules/
The library supports DaVinci Resolve 18.6+ through 21.0.2 and tracks API changes across versions. See CHANGELOG.md for version-specific feature additions and the evolution from DR 18.6 through 21.0.2.
- DaVinci Resolve Dependency: DaVinci Resolve must be running before initializing the library (unless
auto_start=True) - Platform-Specific Paths: Library paths and executable locations are platform-dependent
- API Version Tracking: The library version follows DaVinci Resolve release cycles (2024.x.x, 2025.x.x, 2026.x.x)
- Demo Application: The
test.pyfile is a complete GUI application (not a test suite) that demonstrates:- Fusion UI system integration with custom windows, tabs, and event handlers
- Timeline marker-based still export workflows using
StillManager - Custom logging integration into GUI components
- Real-world usage patterns for the library's high-level APIs