Skip to main content

ONIX validation library and commandline tool

Project description

Onixcheck - Book Trade Metadata Validation

Documentation Status Travis-CI Build Status AppVeyor Build Status PyPI Package latest release PyPI Package monthly downloads

Introduction

ONIX for Books is an international XML standard for the publishing and book trade industry.

onixcheck is a Python library and command line tool for validating ONIX metadata. It allows you to validate ONIX versions 2.1 and 3.0.8 against the official XML Schema.

  • Free software: BSD license

Installation

On Windows you can download the standalone binary command line tool: onixcheck-0.9.7_win.zip

If you have Python or PyPy installed on your system you can do the usual:

pip install onixcheck

Quickstart

Command line usage examples

Validate all .xml, .onx, .onix files in current directory:

onixcheck

Validate a single onix file:

onixcheck myonixfile.xml

Validate all .xml files in /onixdata and its subdirectories:

onixcheck --path /onixdata --ext xml --recursive

Show help:

onixcheck -h

Using onixcheck as a python lib

Simple usage with onixcheck.validate:

>>> import onixcheck
>>> errors = onixcheck.validate('src/onixcheck/data/invalid_onix3_ref.xml')
>>> print(errors[0].short)
ERROR - SCHEMASV - invalid_onix3_ref.xml:4:0 - Element 'SentDateTime': This element is not expected. Expected is ( Sender ).

errors is either a list of Message objects (INVALID file) or an empty list (VALID file)

Documentation

https://onixcheck.readthedocs.org/

Development

To run the all tests run:

tox

Contributions/suggestions are welcome.

Changelog

0.9.7 (2021-09-29)

  • Update Onix 3 to Revision 8 and Code List issue 54

0.9.6 (2019-05-26)

  • Python 3.6 and 3.7 compatibility

  • Update Onix 3 to Revision 6 and Code List issue 45

0.9.5 (2016-08-19)

  • Update Onix 3 to Code List issue 34

  • Remove build artifacts from source distribution

0.9.4 (2016-07-15)

  • Fix issue with windows console output encoding

  • Update windows build to pyinstaller 3.1

0.9.3 (2016-05-10)

  • Update ONIX 3.0 Schemas to Revision 3

  • Add support for RELAX NG and custom schema validations

  • Added validator name to short message output

0.9.2 (2016-04-11)

  • Fix ExtentType in custom validation profile

  • Fix false alarm with multiple Price elements in custom profile

0.9.1 (2016-04-11)

  • Inital support for custom validation profiles

  • Custom Google Play Books onix 3.0 validation profile

0.9.0 (2016-03-27)

  • Added Python 3.5 testing / support

  • Update to ONIX to Code List Issue 32 / 2016-01-24

0.8.1 (2015-07-23)

  • More extensive documentation

0.8.0 (2015-07-23)

  • Added CLI-support for fast directory traversal validation

  • Secured XML-Parsing via defusedxml

  • Catch basic XML syntax errors

  • Windows standalone binary builds

0.4.0 (2015-07-18)

  • First release on PyPI.

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

onixcheck-0.9.7.tar.gz (578.2 kB view details)

Uploaded Source

Built Distribution

onixcheck-0.9.7-py2.py3-none-any.whl (597.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file onixcheck-0.9.7.tar.gz.

File metadata

  • Download URL: onixcheck-0.9.7.tar.gz
  • Upload date:
  • Size: 578.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for onixcheck-0.9.7.tar.gz
Algorithm Hash digest
SHA256 9efdf6d153ea3f44111fce58ea21c9374df36ace15c0439242e30a289c070953
MD5 77876ec069dc58266b2daa63f662632d
BLAKE2b-256 f9cde060a6309eb5a8dd30c65a6bb03a6df6e43e22003fbbb5d3124ffc43401a

See more details on using hashes here.

File details

Details for the file onixcheck-0.9.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for onixcheck-0.9.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a0ee5a49972c0a7c89b79c06b4c38711f382a9bb14f25d866c9b39685721af5a
MD5 ba663e37cebe1bcd0ce4ebab83e7c2e7
BLAKE2b-256 5878ada216233e5cd33239856a1b5956c070155e8629fe91993dd2d5a2a68039

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