Extract EXIF to pandas / SQL / Excel / Feather
Scans recursively your photo library and extracts EXIF data per file to several data formats.
Extracts:
- file size
- gps
- Exif data
Allows export to:
- Excel
- SQLite
- Feather
and anything else that Pandas supports.
Installation
$ pip3 install exif2pandas --user
To export the dataframe you will need one of these modules:
- SQLite:
pip3 install --user SQLAlchemy - Feather:
pip3 install --user pyarrow - Excel:
pip3 install --user xlsxwriter
Python module usage:
from exif2pandas import extract
from pathlib import Path
df = extract.extract_feather(
feather_path=Path('photos.feather').resolve(),
pictures_root=[
Path('/Users/visgean/Dropbox/Photos').resolve(),
],
processes=5
)
Command line usage:
usage: exif2pandas [-h] [-s SQLITE] [-f FEATHER] [-e EXCEL] [-p PROCESSES]
picture_folders [picture_folders ...]
Generate sql database with exif data.
positional arguments:
picture_folders Folders with the images
optional arguments:
-h, --help show this help message and exit
-s SQLITE, --sqlite SQLITE
Output the data frame to SQLite file (this will
override existing file!)
-f FEATHER, --feather FEATHER
Output the data frame to feather file (this will
override existing file!)
-e EXCEL, --excel EXCEL
Output the data frame to excel (this will override
existing file!)
-p PROCESSES, --processes PROCESSES
number of processes to use for collecting exif data,
defaults to 5
Example:
$ exif2pandas ~/Dropbox/Photos/ -s ~/photo_metadata.sqlite
Speed
While this is not a benchmark at all, it takes me about 10 seconds to process 123 GB of photos. This was taken at my Dell XPS 9570 with Intel® Core™ i7-8750H CPU @ 2.20GHz × 12 CPU using 5 processes.
The resulting file is about 13 MB large.
Structure
The following is an example of columns that are generated - some cameras might include different fields.
Custom fields:
- all the columns ending with
-floatare evaluated fractions cleaned_date- this is original date - ignores date set by editors..cleaned_latitude- converted latitude to GPS style, the algorithm is not very precise as far as I knowcleaned_longitude- longitudesize_megabytes- image size in megabytesfilename- original filename
Exif fields:
exif-aperturevalue exif-aperturevalue-float exif-bodyserialnumber exif-brightnessvalue
exif-brightnessvalue-float exif-colorspace exif-componentsconfiguration exif-compressedbitsperpixel
exif-compressedbitsperpixel-float exif-customrendered exif-datetimedigitized exif-datetimeoriginal
exif-digitalzoomratio exif-digitalzoomratio-float exif-exifimagelength exif-exifimagewidth
exif-exifversion exif-exposurebiasvalue exif-exposurebiasvalue-float exif-exposuremode
exif-exposureprogram exif-exposuretime exif-exposuretime-float exif-filesource exif-flash
exif-flashpixversion exif-fnumber exif-fnumber-float exif-focallength exif-focallength-float
exif-focallengthin35mmfilm exif-focalplaneresolutionunit exif-focalplanexresolution
exif-focalplanexresolution-float exif-focalplaneyresolution exif-focalplaneyresolution-float
exif-interoperabilityoffset exif-isospeedratings exif-lensmake exif-lensmodel exif-lensserialnumber
exif-lensspecification exif-lightsource exif-maxaperturevalue exif-maxaperturevalue-float
exif-meteringmode exif-scenecapturetype exif-scenetype exif-sensingmethod exif-sensitivitytype
exif-sharpness exif-shutterspeedvalue exif-shutterspeedvalue-float exif-subjectarea
exif-subjectdistancerange exif-subsectime exif-subsectimedigitized exif-subsectimeoriginal
exif-usercomment exif-whitebalance
GPS fields
gps-gpsaltitude gps-gpsaltitude-float gps-gpsaltituderef gps-gpsdate gps-gpsdestbearing
gps-gpsdestbearing-float gps-gpsdestbearingref gps-gpsdop gps-gpsdop-float gps-gpsimgdirection
gps-gpsimgdirection-float gps-gpsimgdirectionref gps-gpslatitude gps-gpslatituderef
gps-gpslongitude gps-gpslongituderef gps-gpsmapdatum gps-gpsspeed gps-gpsspeed-float
gps-gpsspeedref gps-gpstimestamp gps-gpsversionid
Image Fields:
image-artist image-cfapattern image-cfarepeatpatterndim image-copyright image-datetime
image-datetimeoriginal image-documentname image-exifoffset image-exposuretime
image-exposuretime-float image-fnumber image-fnumber-float image-focallength
image-focallength-float image-gpsinfo image-imagelength image-imagewidth
image-isospeedratings image-make image-model image-orientation image-rating
image-resolutionunit image-sampleformat image-software image-subfiletype
image-xresolution image-xresolution-float image-ycbcrpositioning
image-yresolution-float image-yresolution
Other fields
interoperability-interoperabilityindex interoperability-interoperabilityversion
makernote-afpointset makernote-blurwarning makernote-colortemperature makernote-exposurecount
makernote-exposurewarning makernote-flashmode makernote-flashstrength
makernote-flashstrength-float makernote-focusmode makernote-focuspixel
makernote-focuswarning makernote-hdrimagetype makernote-motororbracket
makernote-noteversion makernote-picturemode makernote-quality makernote-saturation
makernote-sharpness makernote-slowsync makernote-whitebalance makernote-whitebalancefinetune
Metadata
Release files for exif2pandas 2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| exif2pandas-2.1.tar.gz | 7.6 kB | Without provenance | Details for exif2pandas-2.1.tar.gz |
Release files / exif2pandas-2.1.tar.gz
| Download URL | exif2pandas-2.1.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28e08c486e6c903f822aace83ebd14b9d8725d566fba80d88aa755413df83bc1
|
|
BLAKE2b-256 checksum How to use checksums |
3384f1266c99a3364ddfd0a4b653d8e3b691ff8cb064ca276a8baeb26fff8e91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.6
|
Security for exif2pandas 2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.