用于在文件中读/写xmp字段的cli实用程序

xmp-tool的Python项目详细描述


https://travis-ci.org/gaqzi/py-xmp-tool.png?branch=masterLatest VersionDownloads

这是一个读/写单个值的简单命令行实用程序 使用python-xmp-toolkit的xmp文件中的字段。

安装

从pip进行简单安装:

$ pip install xmp-tool
注释python-xmp-toolkit取决于Exempi,这需要
为正确安装xmp而构建。

使用系统包管理器在Mac OS X上安装Exempi,使用 自制:

$ brew install exempi

在基于Debian的Linux系统上,执行以下操作:

# apt-get install libexempi-dev

用法:

$ xmp-tool -h
usage: xmp-tool [-h][--value VALUE][--no-sidecar][field] file [file ...]

Read or write XMP fields in a file

positional arguments:
  field          The field to read/write. If no field specified entire XMP
                 document printed.
  file           A file to work on

optional arguments:
  -h, --help     show this help message and exit
  --value VALUE  A value to write to the field specified
  --no-sidecar   Never write to sidecar files.

读取字段:

$ xmp-tool format test.jpg
test.jpg: format=image/jpeg

读取文件的整个xmp内容:

$ xmp-tool test.jpg
test.jpg: None=<?xpacket begin=""id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Exempi + XMP Core 5.1.2">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:dc="http://purl.org/dc/elements/1.1/">
   <dc:PhysicalMedium>lto01</dc:PhysicalMedium>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>

写入字段:

# First try to read the field when there's no data in it
$ xmp-tool PhysicalMedium test.jpg
test.jpeg: ERROR READING FIELD "PhysicalMedium"# Then try to add the data and then read the field
$ xmp-tool PhysicalMedium --value lto01 test.jpg
$ xmp-tool PhysicalMedium test.jpg
test.jpg: PhysicalMedium=lto01

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

推荐PyPI第三方库


热门话题
Java RMI客户端访问被拒绝   java让JavaFX事件监听器与我的方法对话   java与xml spring配置相关   java当我在字符串中插入这个XML Soap请求时,为什么Eclipse会给我一个错误?   音频音频合成   java创建了一个Tic-Tac-Toe应用程序,我有一个bug,它每次在同一个正方形上声明一个平局   java为返回的字符串值设置参数   Java中的ClassFormatError   java在启动后更改Spring云配置服务器uri   用Java中的自定义类替换默认字符串类   java junit测试套件:ClassNotFoundException   java自定义对象集包含相同的对象   通过关系查找的java Spring数据CRUDepository   java将数据存储到aerospike中   java使用itextpdf将添加内容的pdf转换为安卓中的位图   java正在遍历队列的concurrentHashMap,以查看是否所有队列都是空的,而其他线程可能会添加到队列中   java Hibernate:未找到本机查询异常   java Mockito准确地验证所有参数   java我可以在它自己的类中声明一个对象吗?