def __init__(self, source, url=None, loglevel="ERROR"):
        """init with a local filepath or a URI"""
        super(Schemato, self).__init__()
        self.set_loglevel(loglevel)

        graph_source = source
        if url is not None:
            graph_source = StringIO(source)

        self.graph = CompoundGraph(graph_source)

        def _read_stream(source):
            text, url = self._get_document(source)
            return url, self._document_lines(text)

        parsed_url, self.doc_lines = _read_stream(source)
        self.url = url
        if url is None:
            self.url = parsed_url

        validator = ParselyPageValidator(self.graph, self.doc_lines)
        self.parsely_page = validator.data
def __init__ ( self , source , url = None , loglevel = "ERROR" ) : super ( Schemato , self ) . __init__ ( ) self . set_loglevel ( loglevel ) graph_source = source if url is not None : graph_source = StringIO ( source ) self . graph = CompoundGraph ( graph_source ) def _read_stream ( source ) : text , url = self . _get_document ( source ) return url , self . _document_lines ( text ) parsed_url , self . doc_lines = _read_stream ( source ) self . url = url if url is None : self . url = parsed_url validator = ParselyPageValidator ( self . graph , self . doc_lines ) self . parsely_page = validator . data
init with a local filepath or a URI