Skip to main content

Python library for generating IIIF Image API urls

Project description

# piffle Python library for generating and parsing [IIIF Image API](http://iiif.io/api/image/2.1/) URLs in an object-oriented, pythonic fashion.

[![Build Status](https://travis-ci.org/emory-lits-labs/piffle.svg?branch=develop)](https://travis-ci.org/emory-lits-labs/piffle) [![Coverage Status](https://coveralls.io/repos/github/emory-lits-labs/piffle/badge.svg?branch=develop)](https://coveralls.io/github/emory-lits-labs/piffle?branch=develop) [![Code Health](https://landscape.io/github/emory-lits-labs/piffle/develop/landscape.svg?style=flat)](https://landscape.io/github/emory-lits-labs/piffle/develop)

## Installation and example use:

pip install piffle

Example use for generating an IIIF image 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 `

Example use for parsing an IIIF image 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 `

## Development and Testing

This project uses [git-flow](https://github.com/nvie/gitflow) branching conventions.

Install locally for development (the use of virtualenv is recommended):

pip install -e .

Install test dependencies:

pip install -e “.[test]”

Run unit tests: py.test or python setup.py test

## Publishing

To upload a tagged release to [PyPI](https://pypi.python.org/pypi) with a [wheel](http://pythonwheels.com/) package:

python setup.py sdist bdist_wheel upload

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piffle-0.2.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

piffle-0.2.1-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file piffle-0.2.1.tar.gz.

File metadata

  • Download URL: piffle-0.2.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for piffle-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fffda32011293b87da27a6f259ca532663e75888d9cd4cb52acfe4e3ffc1a973
MD5 f44df7069c2e766afaad2e3950da067c
BLAKE2b-256 8daa22c3ab0e38c48f50f7a4a1d794467875f268db4c6812ed3ada38a971916c

See more details on using hashes here.

File details

Details for the file piffle-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for piffle-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a204da33b9de435796f03fe90d21a5bd44f9372d8f5d3316ebe74e8ff6f1ed47
MD5 94607951402c3099d1ffeb0ac24d3858
BLAKE2b-256 361276e2967c1328b2f56c1f4ac3eb65024a292a9e7ac7ae96c379e6c2c82cbf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page