代码拉取完成,页面将自动刷新
同步操作将从 abc-edb-fund/edb-nbs-rsc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env python 3.6.4
# -*- coding: utf-8 -*-
# @Time : 2018/8/21 15:23
# @Author : Orient
# @File : config.py
# @Software: PyCharm
trans_dict = {
'Service Production Index':'服务业生产指数',
'Business Climate':'工业企业景气',
'Consumer Confidence':'消费者信心',
'Economist Confidence':'经济学家信心',
'Composite PMI Output Index':'综合PMI产出指数',
'Price Indices':'物价',
'Government Finance':'财政',
'FXRate & Reserves':'汇率与外汇储备',
'Industry Production':'工业生产',
'Fixed Assets Investment':'固定资产投资',
'Real Estate Climate':'房地产景气',
'Domestic Trade':'国内贸易',
'Foreign Trade':'对外贸易',
'Money Supply':'货币供应量',
'by Sector':'按部门',
'date release':'发布日程',
'Production and Operation of Construction':'建筑业生产经营情况',
'Retail Sales of Consumer Goods':'社会消费品零售情况',
'Retail Sales of Goods of the Enterprises (units) above Designated Size':'限额以上企业(单位)商品零售类值',
'Foreign Investment':'外商投资',
'Foreign Trade':'对外贸易',
'Transportation':'交通运输',
'Postal':'邮电',
'Telecommunication':'通信',
'VAI':'工业增加值',
'CCI':'消费者信心指数',
'ECI':'经济学家信心指数',
'RPI':'商品零售价格指数',
'Signal':'信号',
'Indices':'指数',
'Delivery Value for Export':'出口交货值',
'Gross Output Value of Agriculture':'农业总产值',
'Time Series':'时间序列指标',
'Regional':'区域性指标',
'Sector Economic Indicators':'部门经济指标',
'Climate Indicators':'景气指标',
'World Economic Indicators':'世界经济指标',
'Price of Rural Market Fairs':'农产品集贸市场价格'
}
class translate(object):
"""docstring for translate."""
def __init__(self, ):
super(translate, self).__init__()
def trans(self,str_trans):
"""
Args:
self
Returns:
str_trans
"""
for item in trans_dict.items():
str_trans = str_trans.replace(item[0],item[1])
return str_trans
import calendar
import re
class time_transfer(object):
"""docstring for time_transfer."""
def __init__(self):
super(time_transfer, self).__init__()
self.id_time = ''
def transfer(self,time_str):
"""时间格式化
Args:
self
time_str
Returns:
self.id_time
"""
y = re.findall(r'^([0-9]{4})', time_str)[0]
m = re.findall(r'([0-9]{1,2})$', time_str)[0]
monthRange = calendar.monthrange(int(y), int(m))
day_end = f'{y}-{m}-{str(monthRange[1])}'
self.id_time = day_end
return self.id_time
import xlwt
class style_head(object):
"""docstring for ."""
def __init__(self, ):
super(style_head, self).__init__()
def style_h(self):
workbook = xlwt.Workbook(encoding='utf-8')
# 创建一个worksheet
worksheet = workbook.add_sheet('sheet1')
# 设置行格式
style_head = xlwt.XFStyle()
# 设置居中
al = xlwt.Alignment()
al.horz = 0x02 # 设置水平居中
al.vert = 0x01 # 设置垂直居中
style_head.alignment = al
# 设置背景色
pattern = xlwt.Pattern()
pattern.pattern = xlwt.Pattern.SOLID_PATTERN
pattern.pattern_fore_colour = xlwt.Style.colour_map['sea_green']
style_head.pattern = pattern
# 设置框线
borders = xlwt.Borders()
borders.left = 1
borders.left_colour = 0x09
borders.right = 1
borders.right_colour = 0x09
borders.top = 1
borders.top_colour = 0x09
borders.bottom = 1
borders.bottom_colour = 0x09
style_head.borders = borders
# 设置字体颜色
font = xlwt.Font()
font.name = u'Arial'
font.colour_index = 1
font.bold = True
style_head.font = font
return style_head
def style_d(self):
workbook = xlwt.Workbook(encoding='utf-8')
# 创建一个worksheet
worksheet = workbook.add_sheet('sheet1')
# 设置行格式
style_data = xlwt.XFStyle()
# 设置字体颜色
font = xlwt.Font()
font.name = u'微软雅黑'
font.colour_index = 0
font.bold = False
style_data.font = font
return style_data
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。