Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Str Assign NameStore Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str ClassDef bases Call NameLoad AttributeLoad NameLoad attr NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad handlers ExceptHandler body Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword NameLoad With Call NameLoad AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr NameStore body For NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad NameLoad attr keyword NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Yield AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad GeneratorExp BoolOpAnd Call NameLoad NameLoad NameLoad CompareIn Str NameLoad comprehension NameStore NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str With Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameStore body For NameStore NameLoad body If Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body With Call NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call NameLoad attr NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad orelse Expr Yield NameLoad decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Delete NameDel decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore BinOpAdd AttributeLoad NameLoad attr NameLoad Assign NameStore Call Call AttributeLoad NameLoad attr Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Slice Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Global identifier If BoolOpAnd NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Assign NameStore NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Global identifier If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list
N/A N/A Module to deal with metadata acquisition. __future__ absolute_import N/A abc N/A logging N/A os N/A re N/A shutil N/A tarfile N/A tempfile contextlib closing contextlib contextmanager rdflib plugin rdflib.graph Graph rdflib.store Store rdflib.term URIRef six with_metaclass gutenberg._domain_model.exceptions CacheAlreadyExistsException gutenberg._domain_model.exceptions InvalidCacheException gutenberg._domain_model.persistence local_path gutenberg._domain_model.vocabulary DCTERMS gutenberg._domain_model.vocabulary PGTERMS gutenberg._util.logging disable_logging gutenberg._util.os makedirs gutenberg._util.os remove gutenberg._util.url urlopen N/A _GUTENBERG_CATALOG_URL http://www.gutenberg.org/cache/epub/feeds/rdf-files.tar.bz2 N/A _DB_IDENTIFIER urn:gutenberg:metadata N/A _DB_PATH N/A local_path N/A N/A N/A os path join metadata metadata.db MetadataCache N/A N/A with_metaclass N/A abc ABCMeta object N/A N/A Super-class for all metadata cache implementations.

     __init__ N/A N/A self store cache_uri N/A N/A N/A N/A self store store N/A N/A self cache_uri cache_uri N/A N/A self graph N/A Graph store N/A self store identifier _DB_IDENTIFIER N/A N/A self is_open False N/A N/A self catalog_source _GUTENBERG_CATALOG_URL N/A exists N/A N/A self N/A N/A N/A Detect if the cache exists.

         N/A N/A N/A N/A os path exists N/A self _local_storage_path N/A property open N/A N/A self N/A N/A N/A Opens an existing cache.

         N/A N/A N/A N/A N/A N/A self graph open N/A self cache_uri create False N/A N/A N/A self _add_namespaces N/A self graph N/A N/A self is_open True N/A N/A N/A N/A N/A InvalidCacheException The cache is invalid or not created N/A close N/A N/A self N/A N/A N/A Closes an opened cache.

         N/A N/A N/A N/A self graph close N/A N/A self is_open False N/A delete N/A N/A self N/A N/A N/A Delete the cache.

         N/A N/A N/A self close N/A N/A remove N/A self _local_storage_path N/A populate N/A N/A self N/A N/A N/A Populates a new cache.

         N/A N/A self exists N/A N/A N/A CacheAlreadyExistsException N/A location: %s N/A self cache_uri N/A N/A N/A self _populate_setup N/A N/A N/A N/A self graph open N/A self cache_uri create True N/A N/A closing N/A self graph N/A N/A N/A N/A self _download_metadata_archive metadata_archive N/A N/A fact N/A N/A self _iter_metadata_triples metadata_archive N/A N/A N/A N/A N/A self graph add fact N/A _populate_setup N/A N/A self N/A N/A N/A Executes operations necessary before the cache can be populated.

         N/A N/A refresh N/A N/A self N/A N/A N/A Refresh the cache by deleting the old one and creating a new one.

         N/A N/A self exists N/A N/A N/A N/A self delete N/A N/A N/A self populate N/A N/A N/A self open N/A _local_storage_path N/A N/A self N/A N/A N/A Returns a path to the on-disk structure of the cache.

         N/A N/A self cache_uri N/A property _add_namespaces N/A N/A graph N/A N/A N/A Function to ensure that the graph always has some specific namespace
        aliases set.

         N/A N/A N/A graph bind pgterms PGTERMS N/A N/A N/A graph bind dcterms DCTERMS N/A staticmethod _download_metadata_archive N/A N/A self N/A N/A N/A Makes a remote call to the Project Gutenberg servers and downloads
        the entire Project Gutenberg meta-data catalog. The catalog describes
        the texts on Project Gutenberg in RDF. The function returns a
        file-pointer to the catalog.

         N/A N/A N/A tempfile NamedTemporaryFile delete False metadata_archive N/A N/A N/A N/A shutil copyfileobj N/A urlopen N/A self catalog_source metadata_archive N/A N/A N/A metadata_archive name N/A N/A remove N/A metadata_archive name N/A contextmanager _metadata_is_invalid N/A N/A fact N/A N/A N/A Determines if the fact is not well formed.

         N/A N/A any N/A N/A N/A isinstance token URIRef N/A token N/A token fact N/A staticmethod _iter_metadata_triples N/A N/A cls metadata_archive_path N/A N/A N/A Yields all meta-data of Project Gutenberg texts contained in the
        catalog dump.

         N/A pg_rdf_regex N/A N/A re compile pg\d+.rdf$ N/A N/A closing N/A N/A tarfile open metadata_archive_path metadata_archive N/A N/A item metadata_archive N/A N/A N/A N/A pg_rdf_regex search N/A item name N/A N/A N/A disable_logging N/A N/A extracted N/A N/A metadata_archive extractfile item N/A graph N/A N/A N/A Graph parse extracted N/A fact graph N/A N/A N/A N/A cls _metadata_is_invalid fact N/A N/A N/A N/A logging info skipping invalid triple %s fact N/A N/A N/A fact N/A classmethod N/A SleepycatMetadataCache N/A MetadataCache N/A N/A Default cache manager implementation, based on Sleepycat/Berkeley DB.
    Sleepycat is natively supported by RDFlib so this cache is reasonably fast.

     __init__ N/A N/A self cache_location N/A N/A N/A N/A N/A self _check_can_be_instantiated N/A cache_uri cache_location N/A store Sleepycat N/A N/A N/A MetadataCache __init__ self store cache_uri N/A _populate_setup N/A N/A self N/A N/A N/A N/A makedirs N/A self cache_uri N/A _check_can_be_instantiated N/A N/A cls N/A N/A N/A N/A bsddb db N/A N/A N/A ImportError N/A N/A N/A bsddb3 db N/A N/A N/A ImportError N/A N/A db None N/A N/A db None N/A N/A N/A InvalidCacheException no install of bsddb/bsddb3 found N/A db N/A classmethod N/A SqliteMetadataCache N/A MetadataCache N/A N/A Cache manager based on SQLite and the RDFlib plugin for SQLAlchemy.
    Quite slow.

     N/A _CACHE_URI_PREFIX sqlite:/// __init__ N/A N/A self cache_location N/A N/A N/A cache_uri N/A N/A self _CACHE_URI_PREFIX cache_location N/A store N/A N/A N/A plugin get SQLAlchemy Store identifier _DB_IDENTIFIER N/A N/A N/A MetadataCache __init__ self store cache_uri N/A _local_storage_path N/A N/A self N/A N/A N/A N/A N/A self cache_uri N/A N/A len N/A self _CACHE_URI_PREFIX N/A property N/A N/A _METADATA_CACHE None set_metadata_cache N/A N/A cache N/A N/A N/A Sets the metadata cache object to use.

     N/A _METADATA_CACHE N/A N/A _METADATA_CACHE N/A _METADATA_CACHE is_open N/A N/A N/A N/A _METADATA_CACHE close N/A _METADATA_CACHE cache N/A get_metadata_cache N/A N/A N/A N/A N/A Returns the current metadata cache object.

     N/A _METADATA_CACHE N/A N/A _METADATA_CACHE None N/A N/A _METADATA_CACHE N/A _create_metadata_cache _DB_PATH N/A _METADATA_CACHE N/A _create_metadata_cache N/A N/A cache_location N/A N/A N/A Creates a new metadata cache instance appropriate for this platform.

     N/A N/A N/A N/A SleepycatMetadataCache cache_location N/A N/A N/A InvalidCacheException N/A N/A N/A N/A logging warning Unable to create cache based on BSD-DB. Falling back to SQLite backend. Performance may be degraded significantly. N/A N/A SqliteMetadataCache cache_location N/A load_metadata N/A N/A refresh_cache N/A False N/A N/A Returns a graph representing meta-data for all Project Gutenberg texts.
    Pertinent information about texts or about how texts relate to each other
    (e.g. shared authors, shared subjects) can be extracted using standard RDF
    processing techniques (e.g. SPARQL queries). After making an initial remote
    call to Project Gutenberg's servers, the meta-data is persisted locally.

     N/A cache N/A get_metadata_cache N/A refresh_cache N/A N/A N/A N/A cache refresh N/A N/A N/A cache is_open N/A N/A N/A N/A cache open N/A N/A cache graph N/A