darkbridge.core – Convert Nikon sidecar files
Convert Nikon sidecar files
The core module schedules operations to convert the sidecar files.
Main task are filtering/checking the supported image files, parsing the
Nikon sidecar files, transforming the metadata and wrinting the result
in a XMP sidecar file compliant with Darktable.
The exported classes, exceptions and functions (and any other objects) are as follows:
darkbridge.core exceptions
Todo
review the list after completing
darkbridge.core classes
|
darkbridge.core constants
Todo
review the list after completing
Using darkbridge.core
Todo
describe how using the module
darkbridge.core reference manual
- class darkbridge.core.DarkBridge(pathname: list[str])
Bases:
objectConvert sidecar files from Nikon NX Studio (.nksc) in sidecar files compliant with Darktable.
Using darkbridge
This class is the scheduler and handles elementary operations to complete the expected task.
The easiest way of using this class is to call the
runmethod. This all-in-one method searches sidecar files in the required folders (and subfolders if required), reads the metadata and create or modify the sidecar files in XMP format at the same level as the original image file.To have more control, you must call individually each method. A typical use case is to build the images files list by calling
parsemethod and run the conversion by callingconvertReference
- convert(dry_run: bool, force: bool, recursive: bool) bool
Run the conversion.
- Parameters:
- Returns:
Trueif the execution went well. In case of failure, an error is written on console.
- filter(path: Path) None | list[Path]
Filter the file list by removing no supported images files or images files without sidecar files.
- Parameters:
path – path of an image file.
- Returns:
the path of the image file and the path of the Nikon sidecar file.
Noneif the image file is not supported or without sidecar- Return type:
a list of two path
- list_metadata() bool
list the metadata specified in the sidecar files.
- Returns:
Trueif the execution went well. In case of failure, an error is written on console.
- parse(recursive: bool) bool
Build the images files list based on patterns as defined in
glob.globfunctions.- Returns:
Trueif the execution went well. In case of failure, an error is written on console.