dataquant 1.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dataquant/__init__.py +150 -0
- dataquant/apis/__init__.py +1 -0
- dataquant/apis/base/__init__.py +2 -0
- dataquant/apis/base/api.py +77 -0
- dataquant/apis/info/__init__.py +1 -0
- dataquant/apis/info/api.py +2300 -0
- dataquant/apis/quote/__init__.py +1 -0
- dataquant/apis/quote/api.py +1744 -0
- dataquant/cd/__init__.py +1 -0
- dataquant/cd/api.py +746 -0
- dataquant/hk/__init__.py +1 -0
- dataquant/hk/api.py +1110 -0
- dataquant/ic/__init__.py +1 -0
- dataquant/ic/api.py +158 -0
- dataquant/intl/__init__.py +1 -0
- dataquant/intl/api.py +137 -0
- dataquant/pof/__init__.py +1 -0
- dataquant/pof/api.py +1963 -0
- dataquant/sql/__init__.py +1 -0
- dataquant/sql/api.py +61 -0
- dataquant/utils/__init__.py +5 -0
- dataquant/utils/client.py +192 -0
- dataquant/utils/common.py +23 -0
- dataquant/utils/config.py +29 -0
- dataquant/utils/config.yml +30 -0
- dataquant/utils/connection.py +502 -0
- dataquant/utils/connection_pool.py +67 -0
- dataquant/utils/consts.py +1 -0
- dataquant/utils/convert.py +54 -0
- dataquant/utils/datetime_func.py +77 -0
- dataquant/utils/decorators.py +125 -0
- dataquant/utils/error.py +159 -0
- dataquant/utils/parallel.py +48 -0
- dataquant-1.1.6.dist-info/METADATA +30 -0
- dataquant-1.1.6.dist-info/RECORD +38 -0
- dataquant-1.1.6.dist-info/WHEEL +5 -0
- dataquant-1.1.6.dist-info/entry_points.txt +3 -0
- dataquant-1.1.6.dist-info/top_level.txt +1 -0
dataquant/cd/api.py
ADDED
|
@@ -0,0 +1,746 @@
|
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
|
2
|
+
import warnings
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
from itertools import product
|
|
6
|
+
|
|
7
|
+
from dataquant.apis.base import get_data
|
|
8
|
+
from dataquant.utils.convert import convert_fields
|
|
9
|
+
from dataquant.utils.datetime_func import get_current_date
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"get_ic_index_info",
|
|
13
|
+
"get_ic_index_data"
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def get_ic_index_info(indx_code_list=None, indx_abbr_list=None, lvl_code=None,
|
|
18
|
+
cols=None, rslt_type=0):
|
|
19
|
+
"""
|
|
20
|
+
获取产业链特色数据信息
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
int_param = \
|
|
25
|
+
[
|
|
26
|
+
]
|
|
27
|
+
float_param = \
|
|
28
|
+
[
|
|
29
|
+
]
|
|
30
|
+
if cols:
|
|
31
|
+
int_param = list(set([]).intersection(set(convert_fields(cols))))
|
|
32
|
+
float_param = list(set([]).intersection(set(convert_fields(cols))))
|
|
33
|
+
else:
|
|
34
|
+
cols = [
|
|
35
|
+
'indx_code', 'indx_name', 'indx_abbr', 'data_val', 'publ_freq',
|
|
36
|
+
'src_name', 'meas_name', 'calb_name', 'strt_date', 'end_date',
|
|
37
|
+
'indx_stat', 'firs_lvl_code', 'firs_lvl_name', 'secd_lvl_code',
|
|
38
|
+
'secd_lvl_name', 'thir_lvl_code', 'thir_lvl_name', 'four_lvl_code',
|
|
39
|
+
'four_lvl_name', 'five_lvl_code', 'five_lvl_name', 'six_lvl_code',
|
|
40
|
+
'six_lvl_name', 'sevn_lvl_code', 'sevn_lvl_name'
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
params = {
|
|
44
|
+
"indx_code_list": indx_code_list,
|
|
45
|
+
"indx_abbr_list": indx_abbr_list,
|
|
46
|
+
"lvl_code": lvl_code,
|
|
47
|
+
"cols": cols,
|
|
48
|
+
"rslt_type": rslt_type,
|
|
49
|
+
"int_param": int_param,
|
|
50
|
+
"float_param": float_param
|
|
51
|
+
}
|
|
52
|
+
return get_data("cd/get_ic_index_info", **params)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def get_ic_index_data(indx_code, strt_date=19900101, end_date=None, cols=None, **kwargs):
|
|
56
|
+
"""
|
|
57
|
+
获取产业链特色数据
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
params = {
|
|
62
|
+
'strt_date': strt_date,
|
|
63
|
+
'end_date': end_date,
|
|
64
|
+
'cols': cols
|
|
65
|
+
}
|
|
66
|
+
params.update(**kwargs)
|
|
67
|
+
|
|
68
|
+
if isinstance(cols, list):
|
|
69
|
+
cols = ','.join(cols)
|
|
70
|
+
|
|
71
|
+
if cols:
|
|
72
|
+
if len({'indx_code', 'data_date'} & set(cols.split(','))) == 0:
|
|
73
|
+
warnings.warn("出参[indx_code, data_date]参数未指定")
|
|
74
|
+
|
|
75
|
+
if indx_code:
|
|
76
|
+
if indx_code == 'IDST0003':
|
|
77
|
+
return get_st_multitb_0003(**params)
|
|
78
|
+
elif indx_code == 'IDZN0140':
|
|
79
|
+
return get_zn_multitb_0140(**params)
|
|
80
|
+
elif indx_code == 'IDZN0141':
|
|
81
|
+
return get_zn_multitb_0141(**params)
|
|
82
|
+
elif indx_code == 'IDZN0142':
|
|
83
|
+
return get_zn_multitb_0142(**params)
|
|
84
|
+
elif indx_code == 'IDZN0143':
|
|
85
|
+
return get_zn_multitb_0143(**params)
|
|
86
|
+
elif indx_code == 'IDZN0144':
|
|
87
|
+
return get_zn_multitb_0144(**params)
|
|
88
|
+
elif indx_code == 'IDZN0145':
|
|
89
|
+
return get_zn_multitb_0145(**params)
|
|
90
|
+
elif indx_code == 'IDZN0146':
|
|
91
|
+
return get_zn_multitb_0146(**params)
|
|
92
|
+
elif indx_code == 'IDZN0147':
|
|
93
|
+
return get_zn_multitb_0147(**params)
|
|
94
|
+
elif indx_code == 'IDZN0148':
|
|
95
|
+
return get_zn_multitb_0148(**params)
|
|
96
|
+
elif indx_code == 'IDZN0149':
|
|
97
|
+
return get_zn_multitb_0149(**params)
|
|
98
|
+
elif indx_code == 'IDZN0150':
|
|
99
|
+
return get_zn_multitb_0150(**params)
|
|
100
|
+
elif indx_code == 'IDZN0151':
|
|
101
|
+
return get_zn_multitb_0151(**params)
|
|
102
|
+
else:
|
|
103
|
+
return None
|
|
104
|
+
else:
|
|
105
|
+
warnings.warn("函数[get_ic_index_data]的参数(indx_code)为必填项")
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def get_st_multitb_0003(strt_date=19900101, end_date=None, regi_name=None, cols=None):
|
|
110
|
+
"""
|
|
111
|
+
获取建筑钢材日出库量
|
|
112
|
+
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
if strt_date is None:
|
|
116
|
+
strt_date = get_current_date()
|
|
117
|
+
if end_date is None:
|
|
118
|
+
end_date = get_current_date()
|
|
119
|
+
|
|
120
|
+
int_param = ['dirt_out', 'drum_out', 'scrw_out', 'is_delt']
|
|
121
|
+
float_param = []
|
|
122
|
+
if cols:
|
|
123
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
124
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
125
|
+
else:
|
|
126
|
+
cols = [
|
|
127
|
+
'indx_code', 'data_date', 'regi_name', 'dirt_out', 'drum_out', 'scrw_out', 'is_delt'
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
fix_cols = ['indx_code', 'data_date']
|
|
131
|
+
if isinstance(cols, str):
|
|
132
|
+
cols = cols.split(',')
|
|
133
|
+
tmp_cols = fix_cols + cols
|
|
134
|
+
cols = list(set(tmp_cols))
|
|
135
|
+
cols.sort(key=tmp_cols.index)
|
|
136
|
+
cols = ','.join(cols)
|
|
137
|
+
|
|
138
|
+
if isinstance(regi_name, list):
|
|
139
|
+
regi_name = ','.join(regi_name)
|
|
140
|
+
|
|
141
|
+
params = {
|
|
142
|
+
"strt_date": strt_date,
|
|
143
|
+
"end_date": end_date,
|
|
144
|
+
"regi_name": regi_name,
|
|
145
|
+
"cols": cols,
|
|
146
|
+
|
|
147
|
+
"int_param": int_param,
|
|
148
|
+
"float_param": float_param
|
|
149
|
+
}
|
|
150
|
+
return get_data("cd/get_st_multitb_0003", **params)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def get_zn_multitb_0140(strt_date=19900101, end_date=None, cols=None):
|
|
154
|
+
"""
|
|
155
|
+
获取焦化产能调研数据
|
|
156
|
+
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
if strt_date is None:
|
|
160
|
+
strt_date = get_current_date()
|
|
161
|
+
if end_date is None:
|
|
162
|
+
end_date = get_current_date()
|
|
163
|
+
|
|
164
|
+
int_param = ['add_cap', 'del_cap', 'net_add_cap', 'is_delt']
|
|
165
|
+
float_param = []
|
|
166
|
+
if cols:
|
|
167
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
168
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
169
|
+
else:
|
|
170
|
+
cols = [
|
|
171
|
+
'indx_code', 'data_date', 'samp_name', 'add_cap', 'del_cap', 'net_add_cap', 'is_delt'
|
|
172
|
+
]
|
|
173
|
+
|
|
174
|
+
fix_cols = ['indx_code', 'data_date']
|
|
175
|
+
if isinstance(cols, str):
|
|
176
|
+
cols = cols.split(',')
|
|
177
|
+
tmp_cols = fix_cols + cols
|
|
178
|
+
cols = list(set(tmp_cols))
|
|
179
|
+
cols.sort(key=tmp_cols.index)
|
|
180
|
+
cols = ','.join(cols)
|
|
181
|
+
|
|
182
|
+
params = {
|
|
183
|
+
"strt_date": strt_date,
|
|
184
|
+
"end_date": end_date,
|
|
185
|
+
"cols": cols,
|
|
186
|
+
|
|
187
|
+
"int_param": int_param,
|
|
188
|
+
"float_param": float_param
|
|
189
|
+
}
|
|
190
|
+
return get_data("cd/get_zn_multitb_0140", **params)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def get_zn_multitb_0141(strt_date=19900101, end_date=None, area_name=None, prov_name=None,
|
|
194
|
+
city_name=None, cnty_name=None, corp_type=None, jl_craft=None, cap_chg=None,
|
|
195
|
+
prd_stat=None, buld_stat=None, cols=None):
|
|
196
|
+
"""
|
|
197
|
+
获取煤焦产能企业统计
|
|
198
|
+
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
if strt_date is None:
|
|
202
|
+
strt_date = get_current_date()
|
|
203
|
+
if end_date is None:
|
|
204
|
+
end_date = get_current_date()
|
|
205
|
+
|
|
206
|
+
int_param = ['desn_cap', 'chmb_high', 'jl_num', 'is_delt']
|
|
207
|
+
float_param = []
|
|
208
|
+
if cols:
|
|
209
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
210
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
211
|
+
else:
|
|
212
|
+
cols = [
|
|
213
|
+
'indx_code', 'data_date', 'corp_code', 'area_name', 'prov_name', 'city_name', 'cnty_name', 'corp_type',
|
|
214
|
+
'jl_craft', 'desn_cap', 'chmb_high', 'jl_num', 'cap_chg', 'prd_stat', 'buld_stat', 'exec_year', 'exec_mth',
|
|
215
|
+
'is_delt'
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
fix_cols = ['indx_code', 'data_date']
|
|
219
|
+
if isinstance(cols, str):
|
|
220
|
+
cols = cols.split(',')
|
|
221
|
+
tmp_cols = fix_cols + cols
|
|
222
|
+
cols = list(set(tmp_cols))
|
|
223
|
+
cols.sort(key=tmp_cols.index)
|
|
224
|
+
cols = ','.join(cols)
|
|
225
|
+
|
|
226
|
+
if isinstance(area_name, list):
|
|
227
|
+
area_name = ','.join(area_name)
|
|
228
|
+
|
|
229
|
+
if isinstance(prov_name, list):
|
|
230
|
+
prov_name = ','.join(prov_name)
|
|
231
|
+
|
|
232
|
+
if isinstance(city_name, list):
|
|
233
|
+
city_name = ','.join(city_name)
|
|
234
|
+
|
|
235
|
+
if isinstance(cnty_name, list):
|
|
236
|
+
cnty_name = ','.join(cnty_name)
|
|
237
|
+
|
|
238
|
+
if isinstance(corp_type, list):
|
|
239
|
+
corp_type = ','.join(corp_type)
|
|
240
|
+
|
|
241
|
+
if isinstance(jl_craft, list):
|
|
242
|
+
jl_craft = ','.join(jl_craft)
|
|
243
|
+
|
|
244
|
+
if isinstance(cap_chg, list):
|
|
245
|
+
cap_chg = ','.join(cap_chg)
|
|
246
|
+
|
|
247
|
+
if isinstance(prd_stat, list):
|
|
248
|
+
prd_stat = ','.join(prd_stat)
|
|
249
|
+
|
|
250
|
+
if isinstance(buld_stat, list):
|
|
251
|
+
buld_stat = ','.join(buld_stat)
|
|
252
|
+
|
|
253
|
+
params = {
|
|
254
|
+
"strt_date": strt_date,
|
|
255
|
+
"end_date": end_date,
|
|
256
|
+
"area_name": area_name,
|
|
257
|
+
"prov_name": prov_name,
|
|
258
|
+
"city_name": city_name,
|
|
259
|
+
"cnty_name": cnty_name,
|
|
260
|
+
"corp_type": corp_type,
|
|
261
|
+
"jl_craft": jl_craft,
|
|
262
|
+
"cap_chg": cap_chg,
|
|
263
|
+
"prd_stat": prd_stat,
|
|
264
|
+
"buld_stat": buld_stat,
|
|
265
|
+
"cols": cols,
|
|
266
|
+
|
|
267
|
+
"int_param": int_param,
|
|
268
|
+
"float_param": float_param
|
|
269
|
+
}
|
|
270
|
+
return get_data("cd/get_zn_multitb_0141", **params)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def get_zn_multitb_0142(strt_date=19900101, end_date=None, area_name=None, cols=None):
|
|
274
|
+
"""
|
|
275
|
+
获取铁矿石高炉开工率(按区域)
|
|
276
|
+
|
|
277
|
+
"""
|
|
278
|
+
|
|
279
|
+
if strt_date is None:
|
|
280
|
+
strt_date = get_current_date()
|
|
281
|
+
if end_date is None:
|
|
282
|
+
end_date = get_current_date()
|
|
283
|
+
|
|
284
|
+
int_param = ['bf_oper_rati', 'cap_util_rati', 'act_prd_out_ad', 'oh_prd_out_ad', 'lmt_prd_out_ad', 'prof_rati',
|
|
285
|
+
'is_delt']
|
|
286
|
+
float_param = []
|
|
287
|
+
if cols:
|
|
288
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
289
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
290
|
+
else:
|
|
291
|
+
cols = [
|
|
292
|
+
'indx_code', 'data_date', 'area_name', 'bf_oper_rati', 'cap_util_rati', 'act_prd_out_ad', 'oh_prd_out_ad',
|
|
293
|
+
'lmt_prd_out_ad', 'prof_rati', 'is_delt'
|
|
294
|
+
]
|
|
295
|
+
|
|
296
|
+
fix_cols = ['indx_code', 'data_date']
|
|
297
|
+
if isinstance(cols, str):
|
|
298
|
+
cols = cols.split(',')
|
|
299
|
+
tmp_cols = fix_cols + cols
|
|
300
|
+
cols = list(set(tmp_cols))
|
|
301
|
+
cols.sort(key=tmp_cols.index)
|
|
302
|
+
cols = ','.join(cols)
|
|
303
|
+
|
|
304
|
+
if isinstance(area_name, list):
|
|
305
|
+
area_name = ','.join(area_name)
|
|
306
|
+
|
|
307
|
+
params = {
|
|
308
|
+
"strt_date": strt_date,
|
|
309
|
+
"end_date": end_date,
|
|
310
|
+
"area_name": area_name,
|
|
311
|
+
"cols": cols,
|
|
312
|
+
|
|
313
|
+
"int_param": int_param,
|
|
314
|
+
"float_param": float_param
|
|
315
|
+
}
|
|
316
|
+
return get_data("cd/get_zn_multitb_0142", **params)
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def get_zn_multitb_0143(strt_date=19900101, end_date=None, prov_name=None, prd_scal=None, cols=None):
|
|
320
|
+
"""
|
|
321
|
+
获取铁矿石高炉开工率(按规模)
|
|
322
|
+
|
|
323
|
+
"""
|
|
324
|
+
|
|
325
|
+
if strt_date is None:
|
|
326
|
+
strt_date = get_current_date()
|
|
327
|
+
if end_date is None:
|
|
328
|
+
end_date = get_current_date()
|
|
329
|
+
|
|
330
|
+
int_param = ['bf_oper_rati', 'cap_util_rati', 'act_prd_out_ad', 'oh_prd_out_ad', 'lmt_prd_out_ad', 'prof_rati',
|
|
331
|
+
'is_delt']
|
|
332
|
+
float_param = []
|
|
333
|
+
if cols:
|
|
334
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
335
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
336
|
+
else:
|
|
337
|
+
cols = [
|
|
338
|
+
'indx_code', 'data_date', 'prov_name', 'prd_scal', 'bf_oper_rati', 'cap_util_rati', 'act_prd_out_ad',
|
|
339
|
+
'oh_prd_out_ad', 'lmt_prd_out_ad', 'prof_rati', 'is_delt'
|
|
340
|
+
]
|
|
341
|
+
|
|
342
|
+
fix_cols = ['indx_code', 'data_date']
|
|
343
|
+
if isinstance(cols, str):
|
|
344
|
+
cols = cols.split(',')
|
|
345
|
+
tmp_cols = fix_cols + cols
|
|
346
|
+
cols = list(set(tmp_cols))
|
|
347
|
+
cols.sort(key=tmp_cols.index)
|
|
348
|
+
cols = ','.join(cols)
|
|
349
|
+
|
|
350
|
+
if isinstance(prov_name, list):
|
|
351
|
+
prov_name = ','.join(prov_name)
|
|
352
|
+
|
|
353
|
+
if isinstance(prd_scal, list):
|
|
354
|
+
prd_scal = ','.join(prd_scal)
|
|
355
|
+
|
|
356
|
+
params = {
|
|
357
|
+
"strt_date": strt_date,
|
|
358
|
+
"end_date": end_date,
|
|
359
|
+
"prov_name": prov_name,
|
|
360
|
+
"prd_scal": prd_scal,
|
|
361
|
+
"cols": cols,
|
|
362
|
+
|
|
363
|
+
"int_param": int_param,
|
|
364
|
+
"float_param": float_param
|
|
365
|
+
}
|
|
366
|
+
return get_data("cd/get_zn_multitb_0143", **params)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
def get_zn_multitb_0144(strt_date=19900101, end_date=None, area_name=None, calb_type=None, cols=None):
|
|
370
|
+
"""
|
|
371
|
+
获取铁矿石港口库存(粗粉)
|
|
372
|
+
|
|
373
|
+
"""
|
|
374
|
+
|
|
375
|
+
if strt_date is None:
|
|
376
|
+
strt_date = get_current_date()
|
|
377
|
+
if end_date is None:
|
|
378
|
+
end_date = get_current_date()
|
|
379
|
+
|
|
380
|
+
int_param = ['inv_num', 'is_delt']
|
|
381
|
+
float_param = []
|
|
382
|
+
if cols:
|
|
383
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
384
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
385
|
+
else:
|
|
386
|
+
cols = [
|
|
387
|
+
'indx_code', 'data_date', 'prd_type', 'samp_name', 'area_name', 'calb_type', 'inv_num', 'is_delt'
|
|
388
|
+
]
|
|
389
|
+
|
|
390
|
+
fix_cols = ['indx_code', 'data_date']
|
|
391
|
+
if isinstance(cols, str):
|
|
392
|
+
cols = cols.split(',')
|
|
393
|
+
tmp_cols = fix_cols + cols
|
|
394
|
+
cols = list(set(tmp_cols))
|
|
395
|
+
cols.sort(key=tmp_cols.index)
|
|
396
|
+
cols = ','.join(cols)
|
|
397
|
+
|
|
398
|
+
if isinstance(area_name, list):
|
|
399
|
+
area_name = ','.join(area_name)
|
|
400
|
+
|
|
401
|
+
if isinstance(calb_type, list):
|
|
402
|
+
calb_type = ','.join(calb_type)
|
|
403
|
+
|
|
404
|
+
params = {
|
|
405
|
+
"strt_date": strt_date,
|
|
406
|
+
"end_date": end_date,
|
|
407
|
+
"area_name": area_name,
|
|
408
|
+
"calb_type": calb_type,
|
|
409
|
+
"cols": cols,
|
|
410
|
+
|
|
411
|
+
"int_param": int_param,
|
|
412
|
+
"float_param": float_param
|
|
413
|
+
}
|
|
414
|
+
return get_data("cd/get_zn_multitb_0144", **params)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def get_zn_multitb_0145(strt_date=19900101, end_date=None, area_name=None, calb_type=None, cols=None):
|
|
418
|
+
"""
|
|
419
|
+
获取铁矿石港口库存(块矿)
|
|
420
|
+
|
|
421
|
+
"""
|
|
422
|
+
|
|
423
|
+
if strt_date is None:
|
|
424
|
+
strt_date = get_current_date()
|
|
425
|
+
if end_date is None:
|
|
426
|
+
end_date = get_current_date()
|
|
427
|
+
|
|
428
|
+
int_param = ['inv_num', 'is_delt']
|
|
429
|
+
float_param = []
|
|
430
|
+
if cols:
|
|
431
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
432
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
433
|
+
else:
|
|
434
|
+
cols = [
|
|
435
|
+
'indx_code', 'data_date', 'prd_type', 'samp_name', 'area_name', 'calb_type', 'inv_num', 'is_delt'
|
|
436
|
+
]
|
|
437
|
+
|
|
438
|
+
fix_cols = ['indx_code', 'data_date']
|
|
439
|
+
if isinstance(cols, str):
|
|
440
|
+
cols = cols.split(',')
|
|
441
|
+
tmp_cols = fix_cols + cols
|
|
442
|
+
cols = list(set(tmp_cols))
|
|
443
|
+
cols.sort(key=tmp_cols.index)
|
|
444
|
+
cols = ','.join(cols)
|
|
445
|
+
|
|
446
|
+
if isinstance(area_name, list):
|
|
447
|
+
area_name = ','.join(area_name)
|
|
448
|
+
|
|
449
|
+
if isinstance(calb_type, list):
|
|
450
|
+
calb_type = ','.join(calb_type)
|
|
451
|
+
|
|
452
|
+
params = {
|
|
453
|
+
"strt_date": strt_date,
|
|
454
|
+
"end_date": end_date,
|
|
455
|
+
"area_name": area_name,
|
|
456
|
+
"calb_type": calb_type,
|
|
457
|
+
"cols": cols,
|
|
458
|
+
|
|
459
|
+
"int_param": int_param,
|
|
460
|
+
"float_param": float_param
|
|
461
|
+
}
|
|
462
|
+
return get_data("cd/get_zn_multitb_0145", **params)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
def get_zn_multitb_0146(strt_date=19900101, end_date=None, area_name=None, var_type=None,
|
|
466
|
+
var_own=None, cols=None):
|
|
467
|
+
"""
|
|
468
|
+
获取铁矿石港口库存(主流品种)
|
|
469
|
+
|
|
470
|
+
"""
|
|
471
|
+
|
|
472
|
+
if strt_date is None:
|
|
473
|
+
strt_date = get_current_date()
|
|
474
|
+
if end_date is None:
|
|
475
|
+
end_date = get_current_date()
|
|
476
|
+
|
|
477
|
+
int_param = ['inv_num', 'is_delt']
|
|
478
|
+
float_param = []
|
|
479
|
+
if cols:
|
|
480
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
481
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
482
|
+
else:
|
|
483
|
+
cols = [
|
|
484
|
+
'indx_code', 'data_date', 'samp_name', 'area_name', 'var_type', 'var_own', 'inv_num', 'is_delt'
|
|
485
|
+
]
|
|
486
|
+
|
|
487
|
+
fix_cols = ['indx_code', 'data_date']
|
|
488
|
+
if isinstance(cols, str):
|
|
489
|
+
cols = cols.split(',')
|
|
490
|
+
tmp_cols = fix_cols + cols
|
|
491
|
+
cols = list(set(tmp_cols))
|
|
492
|
+
cols.sort(key=tmp_cols.index)
|
|
493
|
+
cols = ','.join(cols)
|
|
494
|
+
|
|
495
|
+
if isinstance(area_name, list):
|
|
496
|
+
area_name = ','.join(area_name)
|
|
497
|
+
|
|
498
|
+
if isinstance(var_type, list):
|
|
499
|
+
var_type = ','.join(var_type)
|
|
500
|
+
|
|
501
|
+
if isinstance(var_own, list):
|
|
502
|
+
var_own = ','.join(var_own)
|
|
503
|
+
|
|
504
|
+
params = {
|
|
505
|
+
"strt_date": strt_date,
|
|
506
|
+
"end_date": end_date,
|
|
507
|
+
"area_name": area_name,
|
|
508
|
+
"var_type": var_type,
|
|
509
|
+
"var_own": var_own,
|
|
510
|
+
"cols": cols,
|
|
511
|
+
|
|
512
|
+
"int_param": int_param,
|
|
513
|
+
"float_param": float_param
|
|
514
|
+
}
|
|
515
|
+
return get_data("cd/get_zn_multitb_0146", **params)
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
def get_zn_multitb_0147(strt_date=19900101, end_date=None, area_name=None, calb_type=None, cols=None):
|
|
519
|
+
"""
|
|
520
|
+
获取铁矿石港口库存(货主性质)
|
|
521
|
+
|
|
522
|
+
"""
|
|
523
|
+
|
|
524
|
+
if strt_date is None:
|
|
525
|
+
strt_date = get_current_date()
|
|
526
|
+
if end_date is None:
|
|
527
|
+
end_date = get_current_date()
|
|
528
|
+
|
|
529
|
+
int_param = ['inv_num', 'is_delt']
|
|
530
|
+
float_param = []
|
|
531
|
+
if cols:
|
|
532
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
533
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
534
|
+
else:
|
|
535
|
+
cols = [
|
|
536
|
+
'indx_code', 'data_date', 'samp_name', 'area_name', 'calb_type', 'inv_num', 'is_delt'
|
|
537
|
+
]
|
|
538
|
+
|
|
539
|
+
fix_cols = ['indx_code', 'data_date']
|
|
540
|
+
if isinstance(cols, str):
|
|
541
|
+
cols = cols.split(',')
|
|
542
|
+
tmp_cols = fix_cols + cols
|
|
543
|
+
cols = list(set(tmp_cols))
|
|
544
|
+
cols.sort(key=tmp_cols.index)
|
|
545
|
+
cols = ','.join(cols)
|
|
546
|
+
|
|
547
|
+
if isinstance(area_name, list):
|
|
548
|
+
area_name = ','.join(area_name)
|
|
549
|
+
|
|
550
|
+
if isinstance(calb_type, list):
|
|
551
|
+
calb_type = ','.join(calb_type)
|
|
552
|
+
|
|
553
|
+
params = {
|
|
554
|
+
"strt_date": strt_date,
|
|
555
|
+
"end_date": end_date,
|
|
556
|
+
"area_name": area_name,
|
|
557
|
+
"calb_type": calb_type,
|
|
558
|
+
"cols": cols,
|
|
559
|
+
|
|
560
|
+
"int_param": int_param,
|
|
561
|
+
"float_param": float_param
|
|
562
|
+
}
|
|
563
|
+
return get_data("cd/get_zn_multitb_0147", **params)
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
def get_zn_multitb_0148(strt_date=19900101, end_date=None, area_name=None, calb_type=None, cols=None):
|
|
567
|
+
"""
|
|
568
|
+
获取铁矿石港口库存(球团)
|
|
569
|
+
|
|
570
|
+
"""
|
|
571
|
+
if strt_date is None:
|
|
572
|
+
strt_date = get_current_date()
|
|
573
|
+
if end_date is None:
|
|
574
|
+
end_date = get_current_date()
|
|
575
|
+
|
|
576
|
+
int_param = ['inv_num', 'is_delt']
|
|
577
|
+
float_param = []
|
|
578
|
+
if cols:
|
|
579
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
580
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
581
|
+
else:
|
|
582
|
+
cols = [
|
|
583
|
+
'indx_code', 'data_date', 'samp_name', 'area_name', 'calb_type', 'inv_num', 'is_delt'
|
|
584
|
+
]
|
|
585
|
+
|
|
586
|
+
fix_cols = ['indx_code', 'data_date']
|
|
587
|
+
if isinstance(cols, str):
|
|
588
|
+
cols = cols.split(',')
|
|
589
|
+
tmp_cols = fix_cols + cols
|
|
590
|
+
cols = list(set(tmp_cols))
|
|
591
|
+
cols.sort(key=tmp_cols.index)
|
|
592
|
+
cols = ','.join(cols)
|
|
593
|
+
|
|
594
|
+
if isinstance(area_name, list):
|
|
595
|
+
area_name = ','.join(area_name)
|
|
596
|
+
|
|
597
|
+
if isinstance(calb_type, list):
|
|
598
|
+
calb_type = ','.join(calb_type)
|
|
599
|
+
|
|
600
|
+
params = {
|
|
601
|
+
"strt_date": strt_date,
|
|
602
|
+
"end_date": end_date,
|
|
603
|
+
"area_name": area_name,
|
|
604
|
+
"calb_type": calb_type,
|
|
605
|
+
"cols": cols,
|
|
606
|
+
|
|
607
|
+
"int_param": int_param,
|
|
608
|
+
"float_param": float_param
|
|
609
|
+
}
|
|
610
|
+
return get_data("cd/get_zn_multitb_0148", **params)
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
def get_zn_multitb_0149(strt_date=19900101, end_date=None, area_name=None, calb_type=None, cols=None):
|
|
614
|
+
"""
|
|
615
|
+
获取铁矿石港口库存(精粉)
|
|
616
|
+
|
|
617
|
+
"""
|
|
618
|
+
if strt_date is None:
|
|
619
|
+
strt_date = get_current_date()
|
|
620
|
+
if end_date is None:
|
|
621
|
+
end_date = get_current_date()
|
|
622
|
+
|
|
623
|
+
int_param = ['inv_num', 'is_delt']
|
|
624
|
+
float_param = []
|
|
625
|
+
if cols:
|
|
626
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
627
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
628
|
+
else:
|
|
629
|
+
cols = [
|
|
630
|
+
'indx_code', 'data_date', 'samp_name', 'area_name', 'calb_type', 'inv_num', 'is_delt'
|
|
631
|
+
]
|
|
632
|
+
|
|
633
|
+
fix_cols = ['indx_code', 'data_date']
|
|
634
|
+
if isinstance(cols, str):
|
|
635
|
+
cols = cols.split(',')
|
|
636
|
+
tmp_cols = fix_cols + cols
|
|
637
|
+
cols = list(set(tmp_cols))
|
|
638
|
+
cols.sort(key=tmp_cols.index)
|
|
639
|
+
cols = ','.join(cols)
|
|
640
|
+
|
|
641
|
+
if isinstance(area_name, list):
|
|
642
|
+
area_name = ','.join(area_name)
|
|
643
|
+
|
|
644
|
+
if isinstance(calb_type, list):
|
|
645
|
+
calb_type = ','.join(calb_type)
|
|
646
|
+
|
|
647
|
+
params = {
|
|
648
|
+
"strt_date": strt_date,
|
|
649
|
+
"end_date": end_date,
|
|
650
|
+
"area_name": area_name,
|
|
651
|
+
"calb_type": calb_type,
|
|
652
|
+
"cols": cols,
|
|
653
|
+
|
|
654
|
+
"int_param": int_param,
|
|
655
|
+
"float_param": float_param
|
|
656
|
+
}
|
|
657
|
+
return get_data("cd/get_zn_multitb_0149", **params)
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
def get_zn_multitb_0150(strt_date=19900101, end_date=None, area_name=None, prd_clas=None, var_name=None,
|
|
661
|
+
cols=None):
|
|
662
|
+
"""
|
|
663
|
+
获取铁矿石港口库存(品位)
|
|
664
|
+
|
|
665
|
+
"""
|
|
666
|
+
if strt_date is None:
|
|
667
|
+
strt_date = get_current_date()
|
|
668
|
+
if end_date is None:
|
|
669
|
+
end_date = get_current_date()
|
|
670
|
+
|
|
671
|
+
int_param = ['inv_num', 'is_delt']
|
|
672
|
+
float_param = []
|
|
673
|
+
if cols:
|
|
674
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
675
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
676
|
+
else:
|
|
677
|
+
cols = [
|
|
678
|
+
'indx_code', 'data_date', 'samp_name', 'area_name', 'prd_clas', 'var_name', 'inv_num', 'is_delt'
|
|
679
|
+
]
|
|
680
|
+
|
|
681
|
+
fix_cols = ['indx_code', 'data_date']
|
|
682
|
+
if isinstance(cols, str):
|
|
683
|
+
cols = cols.split(',')
|
|
684
|
+
tmp_cols = fix_cols + cols
|
|
685
|
+
cols = list(set(tmp_cols))
|
|
686
|
+
cols.sort(key=tmp_cols.index)
|
|
687
|
+
cols = ','.join(cols)
|
|
688
|
+
|
|
689
|
+
if isinstance(area_name, list):
|
|
690
|
+
area_name = ','.join(area_name)
|
|
691
|
+
|
|
692
|
+
if isinstance(prd_clas, list):
|
|
693
|
+
prd_clas = ','.join(prd_clas)
|
|
694
|
+
|
|
695
|
+
if isinstance(var_name, list):
|
|
696
|
+
var_name = ','.join(var_name)
|
|
697
|
+
|
|
698
|
+
params = {
|
|
699
|
+
"strt_date": strt_date,
|
|
700
|
+
"end_date": end_date,
|
|
701
|
+
"area_name": area_name,
|
|
702
|
+
"prd_clas": prd_clas,
|
|
703
|
+
"var_name": var_name,
|
|
704
|
+
"cols": cols,
|
|
705
|
+
|
|
706
|
+
"int_param": int_param,
|
|
707
|
+
"float_param": float_param
|
|
708
|
+
}
|
|
709
|
+
return get_data("cd/get_zn_multitb_0150", **params)
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
def get_zn_multitb_0151(strt_date=19900101, end_date=None, area_name=None, cols=None):
|
|
713
|
+
"""
|
|
714
|
+
获取铁矿石港口库存(总览)
|
|
715
|
+
|
|
716
|
+
"""
|
|
717
|
+
if strt_date is None:
|
|
718
|
+
strt_date = get_current_date()
|
|
719
|
+
if end_date is None:
|
|
720
|
+
end_date = get_current_date()
|
|
721
|
+
|
|
722
|
+
int_param = ['inv_tot', 'inv_fo', 'inv_lo', 'inv_pllt', 'inv_pp', 'inv_mgaf', 'inv_mgbf', 'inv_mzaf', 'inv_mqk',
|
|
723
|
+
'inv_mqt', 'mgaf_rati', 'mgbf_rati', 'mzaf_rati', 'mqt_rati', 'is_delt']
|
|
724
|
+
float_param = []
|
|
725
|
+
if cols:
|
|
726
|
+
int_param = list(set(int_param).intersection(set(convert_fields(cols))))
|
|
727
|
+
float_param = list(set(float_param).intersection(set(convert_fields(cols))))
|
|
728
|
+
else:
|
|
729
|
+
cols = [
|
|
730
|
+
'indx_code', 'data_date', 'samp_name', 'area_name', 'inv_tot', 'inv_fo', 'inv_lo', 'inv_pllt', 'inv_pp',
|
|
731
|
+
'inv_mgaf', 'inv_mgbf', 'inv_mzaf', 'inv_mqk', 'inv_mqt', 'mgaf_rati', 'mgbf_rati', 'mzaf_rati', 'mqt_rati',
|
|
732
|
+
'is_delt'
|
|
733
|
+
]
|
|
734
|
+
|
|
735
|
+
params = {
|
|
736
|
+
"strt_date": strt_date,
|
|
737
|
+
"end_date": end_date,
|
|
738
|
+
"area_name": area_name,
|
|
739
|
+
"cols": cols,
|
|
740
|
+
|
|
741
|
+
"int_param": int_param,
|
|
742
|
+
"float_param": float_param
|
|
743
|
+
}
|
|
744
|
+
return get_data("cd/get_zn_multitb_0151", **params)
|
|
745
|
+
|
|
746
|
+
|