#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from .isbntools import get_canonical_isbn


def stdin_validate():
    """ Helper function to validate ISBNs from sys.stdin

    It will output all valid ISBNs that receive from input.

    Usage:
    cat ISBNs| isbn_stdin_validate
    """
    for line in sys.stdin:
        line = line.strip()
        print((get_canonical_isbn(line)))
       
        
if __name__ == "__main__":
    stdin_validate()
