Skip to main content

ONIX validation library and commandline tool

Project description

Onixcheck - Book Trade Metadata Validation

PyPI Package PyPI Downloads DeepWiki

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, 3.0, and 3.1 against the official XML Schema.

  • Free software: Apache License 2.0

Installation

Using uv (Recommended)

For the fastest and most reliable installation, we recommend using the uv tool:

uv tool install onixcheck

Using pip

If you have Python or PyPy installed on your system:

pip install onixcheck

Windows Binary

For Windows users who prefer not to install Python, standalone executables are available on the GitHub Releases page.

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

Enable debug information (more detailed error output):

onixcheck myonixfile.xml --debug

Show help:

onixcheck -h

Using onixcheck as a Python library

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)

Custom schema validation

You can specify custom schema types for validation:

import onixcheck

errors = onixcheck.validate("myfile.xml", schemas=("xsd", "rng", "google"))

Contributions and suggestions are welcome. Please feel free to open issues or pull requests on GitHub.

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.11.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onixcheck-0.9.11-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onixcheck-0.9.11.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for onixcheck-0.9.11.tar.gz
Algorithm Hash digest
SHA256 3e89103f31cc906d2d6b49ba690a947d27fc98531b4fa2174737e8bba8e8f6f0
MD5 79c35e272d2d42adbc7f872a2f941fc5
BLAKE2b-256 21924153f80d3fb44947fa82d0d143ad7dde7d38df71a4983fc20bccc51ba657

See more details on using hashes here.

File details

Details for the file onixcheck-0.9.11-py3-none-any.whl.

File metadata

  • Download URL: onixcheck-0.9.11-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for onixcheck-0.9.11-py3-none-any.whl
Algorithm Hash digest
SHA256 8c5270b5964073a19505dc87ea574a5112a5c24b9bff7efff793ccd7d1de340a
MD5 5fb722b3c07fe1863ee773a2b8cf72a6
BLAKE2b-256 3d8c90a4b614fb6d93ad1f616dd7700842ed310a914331986fed72465ec8818d

See more details on using hashes here.

Supported by

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