将exif提取到pandas/sql/excel/feather


exif2pandas的Python项目详细描述

将exif提取到pandas/sql/excel/feather

摘录:

  • 文件大小
  • 全球定位系统
  • EXIF数据< /LI>

允许导出到:

  • excel
  • sqlite
  • 羽毛

以及任何其他Pandas supports的东西。

安装

    $ pip install exif2pandas --user

要导出数据帧,您需要以下模块之一:

  • sqlite:pip install --user SQLAlchemy
  • 羽毛:pip install --user pyarrow
  • 电子表格:pip install --user xlsxwriter

用法

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

示例:

    $ exif2pandas ~/Dropbox/Photos/ -s ~/photo_metadata.sqlite

速度

虽然这根本不是一个基准,但处理123GB的照片大约需要10秒。 这是在我的Dell XPS 9570上使用Intel®Core™i7-8750h CPU@2.20GHz×12 CPU,使用5个进程拍摄的。

生成的文件大约有13MB大。

结构

下面是生成的列的示例-某些相机可能包含不同的字段。

自定义字段:

  • 所有以-float结尾的列都是计算分数
  • cleaned_date-这是原始日期-忽略编辑器设置的日期。
  • cleaned_latitude-将纬度转换为gps样式,据我所知,该算法并不十分精确
  • cleaned_longitude-经度
  • size_megabytes-图像大小(兆字节)
  • filename-原始文件名
< H2> EXIF字段:
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字段

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-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

其他字段

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 

推荐PyPI第三方库


热门话题
tjson ht 保护器 财政状况 assessment modelfactor crop pythontex 方位角 web3 tum cow cbot 字谜 openvpn clib nextbus tms slurp hashedresource rucio knackutil jgit hiss neodroid bunny 人工 rdn 产品编号 kib tlm pydbsnp polygon3 configparser lauda signac openafs cancer 胃肠道 genome clickpost pyramids 苔藓 ixml subury vielalenv bcolz 统计数据 illumon importerror