How to use the idutils.is_isbn function in idutils

To help you get started, we’ve selected a few idutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inspirehep / inspire-next / inspire / modules / deposit / validators / simple_fields.py View on Github external
def isbn_syntax_validation(form, field):
    """Validate ISBN syntax."""
    message = "The provided ISBN is invalid - it should look \
                similar to '1413304540', '1-4133-0454-0', '978-1413304541' or \
                '978-1-4133-0454-1'."

    if field.data and not is_isbn(field.data):
        raise StopValidation(message)