__init__.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:mygene.py 作者: biothings 项目源码 文件源码
def set_caching(self, cache_db='mygene_cache', verbose=True, **kwargs):
        ''' Installs a local cache for all requests.
            **cache_db** is the path to the local sqlite cache database.'''
        if caching_avail:
            requests_cache.install_cache(cache_name=cache_db, allowable_methods=('GET', 'POST'), **kwargs)
            self._cached = True
            if verbose:
                print('[ Future queries will be cached in "{0}" ]'.format(os.path.abspath(cache_db + '.sqlite')))
        else:
            print("Error: The requests_cache python module is required to use request caching.")
            print("See - https://requests-cache.readthedocs.io/en/latest/user_guide.html#installation")
        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号