ONIX validation library and commandline tool
Project description
Onixcheck - Book Trade Metadata Validation
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 against the official XML Schema.
Free software: BSD license
Installation
On Windows you can download the standalone binary command line tool: onixcheck-0.8.0_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 - 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
Development
To run the all tests run:
tox
Contributions/suggestions are welcome.
Changelog
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for onixcheck-0.8.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de38a6018a350eec0061c1b929b2cc28701da5394be4fea9255e5ff9a4f9222a |
|
MD5 | ece07ed7eb1e9e11a6af66143a394019 |
|
BLAKE2b-256 | 841c3e2ded323d8fd77543c69e44a90adba75151671f5dc05eb4766e406fa3c3 |