I need to get the date from NEF file with Python. I saw some libraries such as rawdata and piexif that might work, but cannot figure out. Is there a simple way to get metadata from NEF images? While I am interested in “date taken” I would be interested in a generic way to pull more metadata parameters. Here is my current attempt:
from PIL import Image
import piexif
im = Image.open("image.NEF")
exif_data = piexif.load(im.info["exif"])
date = exif_data['0th'][piexif.ImageIFD.DateTime]