将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为什么参数。getType()。isInstance(HttpServletRequest.class)返回值为false,但use“==”为true   使用Java的文本文件中的简单列表   linux Java创建具有特定所有者(用户/组)的文件和目录   java我试图解析一个文本文件,以计数唯一字符串的数量,并打印一些关于这些字符串的信息   雅加达ee如何使用JavaEE6@Resource注释   java从数据库中获取所有值,并将其存储在字符串数组中   java需要ArrayList中的单个数组   java变量id可能未使用lombok初始化Spring引导控制器   JavaS3客户端。读取超过文件大小时的GetObject行为   java在另一个活动列表视图中显示JSONObject   java spring引导fat jar注册到带有奇怪端口的eureka   java如何与mongoDB建立Android Studio连接?   java LinkedIn OAuth2/oauth/v2/accessToken响应未返回“令牌类型”   java如何在jtree中只列出非隐藏和非系统文件   Mybatis批量将Java BigDecimal插入SQL Server decimal(18,2)无法正常工作   java Hibernate Criteria Builder:如何按可为空的实体属性进行筛选?   如果涉及方法内变量的范围,python与java是否不同?   java如何实现web服务客户端,该客户端通过基于NTLM身份验证的身份验证连接到外部web服务   java使Jackson在反序列化期间无法将double转换为int