本文整理匯總了Python中dlstats.fetchers._commons.Datasets.doc_href方法的典型用法代碼示例。如果您正苦於以下問題:Python Datasets.doc_href方法的具體用法?Python Datasets.doc_href怎麽用?Python Datasets.doc_href使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dlstats.fetchers._commons.Datasets
的用法示例。
在下文中一共展示了Datasets.doc_href方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: upsert_sna
# 需要導入模塊: from dlstats.fetchers._commons import Datasets [as 別名]
# 或者: from dlstats.fetchers._commons.Datasets import doc_href [as 別名]
def upsert_sna(self, url, dataset_code):
dataset = Datasets(self.provider_name,dataset_code,
fetcher=self)
sna_data = EsriData(dataset,url)
dataset.name = self.dataset_name[dataset_code]
dataset.doc_href = 'http://www.esri.cao.go.jp/index-e.html'
dataset.last_update = sna_data.release_date
dataset.series.data_iterator = sna_data
dataset.update_database()
示例2: upsert_dataset
# 需要導入模塊: from dlstats.fetchers._commons import Datasets [as 別名]
# 或者: from dlstats.fetchers._commons.Datasets import doc_href [as 別名]
def upsert_dataset(self, dataset_code, sheet):
start = time.time()
logger.info("upsert dataset[%s] - START" % (dataset_code))
dataset = Datasets(self.provider_name,dataset_code,
fetcher=self)
bea_data = BeaData(dataset,self.url, sheet)
dataset.name = dataset_code
dataset.doc_href = 'http://www.bea.gov/newsreleases/national/gdp/gdpnewsrelease.htm'
dataset.last_update = bea_data.release_date
dataset.series.data_iterator = bea_data
dataset.update_database()
self.update_metas(dataset_code)
end = time.time() - start
logger.info("upsert dataset[%s] - END - time[%.3f seconds]" % (dataset_code, end))
示例3: upsert_dataset
# 需要導入模塊: from dlstats.fetchers._commons import Datasets [as 別名]
# 或者: from dlstats.fetchers._commons.Datasets import doc_href [as 別名]
def upsert_dataset(self, dataset_code):
self.get_selected_datasets()
dataset_settings = self.selected_datasets[dataset_code]
dataset = Datasets(
provider_name=self.provider_name, dataset_code=dataset_code, name=dataset_settings["name"], fetcher=self
)
if dataset_code in DATASETS:
dataset.series.data_iterator = ExcelData(dataset, DATASETS[dataset_code]["url"])
dataset.doc_href = DATASETS[dataset_code]["doc_href"]
else:
dataset.last_update = clean_datetime()
dataset.series.data_iterator = WorldBankAPIData(dataset, dataset_settings)
return dataset.update_database()
示例4: upsert_dataset
# 需要導入模塊: from dlstats.fetchers._commons import Datasets [as 別名]
# 或者: from dlstats.fetchers._commons.Datasets import doc_href [as 別名]
def upsert_dataset(self, dataset_code):
"""Updates data in Database for selected datasets
:dset: dataset_code
:returns: None"""
self.get_selected_datasets()
start = time.time()
logger.info("upsert dataset[%s] - START" % (dataset_code))
self.dataset_settings = self.selected_datasets[dataset_code]
url = self.make_url()
dataset = Datasets(self.provider_name,dataset_code,
fetcher=self)
dataset.name = self.dataset_settings['name']
dataset.doc_href = self.dataset_settings['metadata']['doc_href']
dataset.last_update = self.dataset_settings['last_update']
data_iterator = EsriData(dataset,url,filename=dataset_code)
dataset.series.data_iterator = data_iterator
dataset.update_database()
end = time.time() - start
logger.info("upsert dataset[%s] - END - time[%.3f seconds]" % (dataset_code, end))