chemigram.core.exif¶
chemigram.core.exif
¶
Read camera/lens metadata from raw files for L1 vocabulary binding.
Uses exifread (pure-Python, no native deps) to extract the EXIF
fields chemigram cares about: Make, Model, LensModel,
FocalLength. Per RFC-015 / ADR-053, downstream binding
(:mod:chemigram.core.binding) is exact-match on
(make, model, lens_model) — this module only extracts.
Per ADR-007 (BYOA), the dependency stays in chemigram.core's
graph because EXIF is structural metadata, not AI capability — every
raw a photographer drops in needs identity resolution before any
vocabulary applies. PyExifTool (faster, more complete) is rejected for
v1 because it requires the exiftool binary as an external dep.
Public API
- :func:
read_exif— extract EXIF from a raw file - :class:
ExifData— frozen dataclass with the four fields we model - :class:
ExifReadError— exception raised on unreadable input
ExifReadError
¶
Bases: Exception
Raised when EXIF cannot be read from a file.
ExifData
dataclass
¶
The EXIF fields chemigram cares about for L1 binding.
String fields are whitespace- and null-stripped. Missing string
fields become empty strings (not None) so callers don't need
to special-case absence vs. presence-of-empty.
read_exif
¶
Read relevant EXIF tags from a raw file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
path to a raw (NEF, ARW, RAF, CR2, ...). |
required |
Returns:
| Type | Description |
|---|---|
ExifData
|
class: |
ExifData
|
string fields become |
ExifData
|
becomes |
Raises:
| Type | Description |
|---|---|
ExifReadError
|
corrupt or unreadable file. |
FileNotFoundError
|
|