用于生成图像api url的python库
piffle的Python项目详细描述
#piffle
用于在 面向对象,pythonic时尚。
[![生成状态](https://travis-ci.org/Princeton-CDH/piffle.svg?branch=master)](https://travis-ci.org/Princeton-CDH/piffle) [![覆盖状态](https://coveralls.io/repos/github/Princeton-CDH/piffle/badge.svg?branch=master)](https://coveralls.io/github/Princeton-CDH/piffle?分支=主) [![说声谢谢!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/cdhdevteam)
piffle在python 2.7和3.3-3.6上进行了测试。
Piffle最初是由埃默里大学作为 [readux](https://github.com/ecds/readux>;)并作为单独的项目分叉 在[emory lits labs]下(https://github.com/emory-lits-labs/)。
##安装和示例使用:
pip安装piffle
用于生成iif图像url的示例:
` >>> from piffle.iiif import IIIFImageClient >>> myimg = IIIFImageClient('http://image.server/path/', 'myimgid') >>> print myimg http://image.server/path/myimgid/full/full/0/default.jpg >>> print myimg.info() http://image.server/path/myimgid/info.json" >>> print myimg.size(width=120).format('png')http://image.server/path/myimgid/full/120,/0/default.png `
用于分析IIIF图像URL的示例:
` >>> from piffle.iiif import IIIFImageClient >>> myimg = IIIFImageClient.init_from_url('http://www.example.org/image-service/abcd1234/full/full/0/default.jpg') >>> print myimg http://www.example.org/image-service/abcd1234/full/full/0/default.jpg >>> print myimg.info() http://www.example.org/image-service/abcd1234/info.json >>> myimg.as_dict()['size']['full'] True >>> myimg.as_dict()['size']['exact'] False >>> myimg.as_dict()['rotation']['degrees'] 0.0 `
##开发和测试
这个项目使用[git flow](https://github.com/nvie/gitflow)分支约定。
本地安装以便开发(建议使用virtualenv):
pip安装-e.
安装测试依赖项:
pip install-e.“[测试]”
运行单元测试:py.test或python setup.py test
##出版
使用 一个[轮子](http://pythonwheels.com/)包:
python setup.py sdist bdist_wheel upload