将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 

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java不支持ArrayList。clear()方法释放内存?   java有一种保持测试的方法。Bat文件打开并运行其余的代码?   java XMLSocketReceiver和SocketReceiver是如何工作的?   Java ArrayList StringBuilder附加   java Jsoup从html表中提取数据   java JAXB通用XmlAdapter实现   java在半秒钟后更新JLabel中包含的图片   java如何在组织中打印整个标记结构。jdom。文档对象?   java我的公共int没有使用正确的参数,我的调用是否错误?   mysql与Java Rest Webservice的手动数据库连接(jersey)   java这个同步代码是如何中断的?   java试图在关闭的EntityManager上执行操作(在命名查询上调用setParameter()函数时)   java在使用流生成映射时忽略重复项   java使用整数创建日期并显示在文本框中   java在运行时动态更改类字段的注释