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