capturegraph.adapters.add_dates
#
Add Dates Adapter#
Extract EXIF dates from images in a CaptureTarget and save them as PTime-formatted JSON files.
Example
from pathlib import Path
from capturegraph.data import CaptureTarget
from capturegraph.adapters import add_dates
# Load target
target = CaptureTarget(Path("./MyCapture"))
# Add date files for all images
add_dates(target)
# Each image like "photo.dng" will have a companion "photo_date.json" with:
# {"time_since_1970": 1705315800.0}
add_dates(target)
#
Add date JSON files for all images with EXIF data in a CaptureTarget.
Traverses the entire target, finds all image files, extracts the DateTimeOriginal timestamp, and writes a companion JSON file with the date in PTime format.
The output file is named {original_filename_without_extension}_date.json and
contains {"time_since_1970": <seconds>} matching the CaptureGraph PTime format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
CaptureTarget
|
The CaptureTarget to process |
required |
Returns:
| Type | Description |
|---|---|
list[Path]
|
List of paths to created JSON files. |