projectstats.py 文件源码

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

项目:pypi-download-stats 作者: jantman 项目源码 文件源码
def __init__(self, project_name, cache_instance):
        """
        Initialize a ProjectStats class for the specified project.
        :param project_name: project name to calculate stats for
        :type project_name: str
        :param cache_instance: DataCache instance
        :type cache_instance: :py:class:`~.DiskDataCache`
        """
        logger.debug('Initializing ProjectStats for project: %s', project_name)
        self.project_name = project_name
        self.cache = cache_instance
        self.cache_data = {}
        self.cache_dates = self._get_cache_dates()
        self.as_of_timestamp = self._cache_get(
            self.cache_dates[-1])['cache_metadata']['data_ts']
        self.as_of_datetime = datetime.fromtimestamp(
            self.as_of_timestamp, utc).astimezone(get_localzone())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号