Skip to content

Commit 020bb4a

Browse files
author
zhangyongsheng
committed
添加sup库查询
1 parent b96c7a6 commit 020bb4a

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2019-06-05
2+
- 添加sup库
3+
14
# 2019-05-10
25
- 更新python2环境下run_query不支持中文
36

jqdatasdk/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def logout():
2424
JQDataClient.instance().logout()
2525

2626

27-
__version__ = "1.6.5"
27+
__version__ = "1.6.6"
2828

2929

3030
__all__ = ["auth", "auth_by_token", "logout", "alpha101", "alpha191", "technical_analysis", "__version__"]

jqdatasdk/table.py

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"opt",
1616
"ssymmetry",
1717
"bond",
18+
"sup",
1819
"DBTable",
1920
]
2021

@@ -27,6 +28,7 @@ def __init__(self, db, disable_join=False):
2728
self.__table_names = []
2829
self.db_name = db
2930

31+
@assert_auth
3032
def __load_table_names(self):
3133
self.__table_names = JQDataClient.instance().get_table_orm(db=self.db_name)
3234
for name in self.__table_names:
@@ -86,3 +88,4 @@ def __getattribute__(self, key):
8688
opt = DBTable("opt")
8789
ssymmetry = DBTable("ssymmetry")
8890
bond = DBTable("bond")
91+
sup = DBTable("sup")

tests/test_table.py

+14
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,17 @@ def test_bond():
3535
'04001,"bond_form":"\\u8bb0\\u8d26\\u5f0f","list_date":1389225600000,"delist_Date'
3636
'":1420416000000,"interest_begin_date":1389139200000,"maturity_date":1420675200000,'
3737
'"interest_date":null,"last_cash_date":1420675200000,"cash_comment":null}')
38+
39+
40+
def test_sup():
41+
df = sup.run_query(query(sup.STK_FINANCE_SUPPLEMENT).limit(10))
42+
assert len(df) == 10
43+
assert df.iloc[0].to_json() == (
44+
'{"id":1,"company_id":300000062,"company_name":"\\u5e7f\\u4e1c\\u5fb7\\u7f8e\\u7cbe'
45+
'\\u7ec6\\u5316\\u5de5\\u96c6\\u56e2\\u80a1\\u4efd\\u6709\\u9650\\u516c\\u53f8",'
46+
'"code":"002054.XSHE","a_code":"002054","b_code":null,"h_code":null,'
47+
'"pub_date":1151020800000,"start_date":1041379200000,"end_date":1072828800000,'
48+
'"report_date":1072828800000,"report_type":0,"source_id":321001,"source":"\\u62db'
49+
'\\u52df\\u8bf4\\u660e\\u4e66","bill_and_account_receivable":null,'
50+
'"bill_and_account_payable":null,"rd_expenses":null}'
51+
)

0 commit comments

Comments
 (0)