Micro-sheep / Micro-sheep/efinance

关于「名称」或「code」重名时,查询结果和期望不一致的疑问?

Open
#176 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.1k
Forks
755
PR merge metrics
No merged PRs in 30d

Description

当我要查询的「代码」或者「名称」重名了,指向了两个不同的股票/指数的时候,好像永远只能获取到其中固定的一个结果。
market_type并不能解决问题?(1:market_type和ef.utils.search_quote中获取的market_type并不是同一个东西;2:现有手段其实并不能查询到某一个股票的market_type是什么,我都不知道,那更没法用market_type来查询了)

那如何才能获取所有的结果呢?或者如何才能拿到期望的值?

看源代码,好像最终都是通过quote_id去查询的数据,但封装的接口好像不支持用quote_id去查询各类数据。
那如果处理重名问题呀?请不吝赐教,非常感谢!

譬如:
1.查询【000100】,可能期望是:
[
{
"code": "000100",
"name": "TCL科技",
"pinyin": "TCLKJ",
"id": "0001002",
"jys": "6",
"classify": "AStock",
"market_type": "2",
"security_typeName": "深A",
"security_type": "2",
"mkt_num": "0",
"type_us": "6",
"quote_id": "0.000100",
"unified_code": "000100",
"inner_code": "35851998011206"
},
{
"code": "000100",
"name": "上证F500",
"pinyin": "SZF500",
"id": "0001001",
"jys": "1",
"classify": "Index",
"market_type": "1",
"security_typeName": "指数",
"security_type": "5",
"mkt_num": "1",
"type_us": "1",
"quote_id": "1.000100",
"unified_code": "000100",
"inner_code": "29676111691840"
}
]

2.查询【中证500】,可能是:
[
{
"value": "1.000905",
"code": "000905",
"name": "中证500",
"pinyin": "ZZ500",
"id": "0009051",
"jys": "1",
"classify": "Index",
"market_type": "1",
"security_typeName": "指数",
"security_type": "5",
"mkt_num": "1",
"type_us": "1",
"quote_id": "1.000905",
"unified_code": "000905",
"inner_code": "47193402436496"
},
{
"value": "0.399905",
"code": "399905",
"name": "中证500",
"pinyin": "ZZ500",
"id": "3999052",
"jys": "5",
"classify": "Index",
"market_type": "2",
"security_typeName": "指数",
"security_type": "5",
"mkt_num": "0",
"type_us": "5",
"quote_id": "0.399905",
"unified_code": "399905",
"inner_code": "23230172814944"
},
{
"value": "90.BK0701",
"code": "BK0701",
"name": "中证500",
"pinyin": "ZZ500",
"id": "BK07011",
"jys": "3",
"classify": "BK",
"market_type": "1",
"security_typeName": "板块",
"security_type": "9",
"mkt_num": "90",
"type_us": "3",
"quote_id": "90.BK0701",
"unified_code": "BK0701",
"inner_code": "24950575717760"
}
]

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the search_quote path mentioned in the issue and follow how it resolves names or codes into quote_id values. Compare that behavior with the supplied duplicate results and market_type examples, then inspect the existing public lookup interfaces. Done means the intended handling of duplicate securities is defined and users can retrieve the expected result or all matching results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.