gutenberg/acquire/metadata.py
def _iter_metadata_triples(cls, metadata_archive_path):
        """Yields all meta-data of Project Gutenberg texts contained in the
        catalog dump.

        """
        pg_rdf_regex = re.compile(r'pg\d+.rdf$')
        with closing(tarfile.open(metadata_archive_path)) as metadata_archive:
            for item in metadata_archive:
                if pg_rdf_regex.search(item.name):
                    with disable_logging():
                        extracted = metadata_archive.extractfile(item)
                        graph = Graph().parse(extracted)
                    for fact in graph:
                        if cls._metadata_is_invalid(fact):
                            logging.info('skipping invalid triple %s', fact)
                        else:
                            yield fact
Yields all meta-data of Project Gutenberg texts contained in the
        catalog dump.

        
Yields all meta-data of Project Gutenberg texts contained in the
catalog dump.
Yields all meta - data of Project Gutenberg texts contained in the catalog dump .
def _iter_metadata_triples(cls, metadata_archive_path):
        pg_rdf_regex = re.compile(r'pg\d+.rdf$')
        with closing(tarfile.open(metadata_archive_path)) as metadata_archive:
            for item in metadata_archive:
                if pg_rdf_regex.search(item.name):
                    with disable_logging():
                        extracted = metadata_archive.extractfile(item)
                        graph = Graph().parse(extracted)
                    for fact in graph:
                        if cls._metadata_is_invalid(fact):
                            logging.info('skipping invalid triple %s', fact)
                        else:
                            yield fact
def _iter_metadata_triples ( cls , metadata_archive_path ) : pg_rdf_regex = re . compile ( r'pg\d+.rdf$' ) with closing ( tarfile . open ( metadata_archive_path ) ) as metadata_archive : for item in metadata_archive : if pg_rdf_regex . search ( item . name ) : with disable_logging ( ) : extracted = metadata_archive . extractfile ( item ) graph = Graph ( ) . parse ( extracted ) for fact in graph : if cls . _metadata_is_invalid ( fact ) : logging . info ( 'skipping invalid triple %s' , fact ) else : yield fact
Yields all meta-data of Project Gutenberg texts contained in the
catalog dump.
Yields all meta - data of Project Gutenberg texts contained in the catalog dump .
"""Yields all meta-data of Project Gutenberg texts contained in the
        catalog dump.

        """
cls
metadata_archive_path