Skip to content

Commit 4558b33

Browse files
committed
chore: update dependencies and version for openbb-akshare
- Bump version from 1.0.5 to 1.0.6 in pyproject.toml - Update Python requirement to >=3.11,<3.13 - Upgrade akshare to 1.17.91 and openbb-core to ^1.5.6 - Add openbb dependency with version 4.5.0 - Update mysharelib to ^1.0.4 - Upgrade openbb-devtools to ^1.5.3 and add pytest as a dev dependency - Add a new Jupyter notebook test.ipynb for testing akshare integration - Create a new test file tests/test_company_news.py with parameterized tests for equity news
1 parent ed1e626 commit 4558b33

File tree

5 files changed

+4452
-2747
lines changed

5 files changed

+4452
-2747
lines changed

openbb_akshare/models/company_news.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ async def aextract_data(
6969
symbols = query.symbol.split(",") # type: ignore
7070
async def get_one(symbol):
7171
from mysharelib.sina.scrape_hk_stock_news import scrape_hk_stock_news
72+
from mysharelib.em.stock_info_em import stock_info_em
7273

7374
symbol_b, _, market = normalize_symbol(symbol)
7475
if market == "HK":
@@ -81,12 +82,10 @@ async def get_one(symbol):
8182
new_content["url"] = d["url"]
8283
results.append(new_content)
8384
else:
84-
data = ak.stock_news_em(symbol)
85+
data = stock_info_em(symbol)
8586
for idx, d in data.iterrows():
8687
new_content: dict = {}
87-
new_content["text"] = d["新闻内容"]
8888
new_content["url"] = d["新闻链接"]
89-
new_content["source"] = d["文章来源"]
9089
new_content["title"] = d["新闻标题"]
9190
new_content["date"] = d["发布时间"]
9291

0 commit comments

Comments
 (0)