This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This validator supports the same validations that are available on the IIIF website at http://iiif.io/api/image/validator/.

Installation

Dependencies:

  • lxml
  • bottle
  • python-magic (which requires libmagic)
  • PIL (via Pillow)

On a mac one can do:

brew install libmagic
pip install lxml bottle python-magic pillow

Command line validator, iiif-validate.py

Then for an image served at http://localhost:8000/prefix/image_id the validator can be run with:

iiif-validate.py -s localhost:8000 -p prefix -i image_id --version=2.0 -v

or similar to validate server with the test image. Use iiif-validate -h for parameter details.

Use with Travis CI

To install dependencies for this code the following lines must be present in the install: section of .travis.yml:

install:
  - sudo apt-get update
  - sudo apt-get install libmagic-dev
  - pip install Pillow iiif_validator
  ...

and then a single validation can be added to the commands under the script: section of .travis.yml. For example, to test a server running with base URI http://localhost:8000/prefix with image image_id1 at version 1.1, level 1, one might use:

script:
  ...
  - iiif-validate.py -s localhost:8000 -p prefix -i image_id1 --version=1.1 --level 1 --quiet

The iiif-validate.py script returns 0 exit code on success, non-zero on failure, in order to work easily with Travis CI.

Running the validator server, iiif-validator.py

The primary installation of the validator server is on the IIIF website at http://iiif.io/api/image/validator/.

Stand-alone server

The validator server runs at http://localhost:8080/ by default, the URI path is the test name and then the query parameters give the details of the server and image to be tested. The URI pattern is:

http://localhost:8080/{test_name}?server={server}&prefix={prefix}&identifer={id}&version={api_version}

As an example, if the test server <https://pypi.python.org/pypi/iiif> is installed and run locally:

easy_install iiif
iiif_testserver.py

which will set up a server at http://localhost:8000/ and write the log of accesses to STDOUT. The one can run validation tests against this with requests like http://localhost:8080/info_json?server=localhost:8000&prefix=/2.0_pil_none&identifier=67352ccc-d1b0-11e1-89ae-279075081939.png&version=2.0 which tests the info.json response and gives JSON output (pretty formatted here):

{
  "test": "info_json",
  "status": "success",
  "tests": ["required-field: width", "required-field: height", "type-is-int: height", "type-is-int: width", "required-field: @id", "type-is-uri: @id", "@id is correct URI", "required-field: @context", "correct-context", "required-field: protocol", "correct-protocol", "required-field: profile", "is-list", "profile-compliance", "is-list", "is-object", "required-field: scaleFactors", "required-field: width", "type-is-int: width"],
  "url": ["http://localhost:8000/2.0_pil_none/67352ccc-d1b0-11e1-89ae-279075081939.png/info.json"],
  "label": "Check Image Information"
}

and http://localhost:8080/rot_mirror?server=localhost:8000&prefix=/2.0_pil_none&identifier=67352ccc-d1b0-11e1-89ae-279075081939.png&version=2.0 which tests mirroring and will give JSON output (again pretty formatted):

{
  "test": "rot_mirror",
  "status": "success",
  "tests": ["9,0:True", "0,9:True"],
  "url": ["http://localhost:8000/2.0_pil_none/67352ccc-d1b0-11e1-89ae-279075081939.png/full/full/!0/default.jpg"],
  "label": "Mirroring"
}

Validator server under WSGI

need docs here

Editing this README

This README is in reStructuredText and not gfm because that is what pypi will render. An editor like http://rst.ninjs.org/ is useful for editing/checking interactively.

Release History

Release History

1.0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
iiif-validator-1.0.1.tar.gz (17.1 kB) Copy SHA256 Checksum SHA256 Source May 20, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting