Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #40

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Dev #40

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ master

专注股票量化数据,为Ai(爱)发电,向阳而生。

1.0.1 (2023-10-10)
------------------
1. 兼容python3.6:支持qmt python3.6版本导入
2. 依赖版本降低,扩大兼容性。

1.0.0 (2023-09-13)
------------------
1. 更新:正式发布1.0.0正式版本
Expand Down
12 changes: 6 additions & 6 deletions adata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

import logging

from .__version__ import __version__
from .bond import bond
from .common.utils.sunrequests import SunProxy
from .fund import fund
from .sentiment import sentiment
from .stock import stock
from adata.__version__ import __version__
from adata.bond import bond
from adata.common.utils.sunrequests import SunProxy
from adata.fund import fund
from adata.sentiment import sentiment
from adata.stock import stock


def version():
Expand Down
2 changes: 1 addition & 1 deletion adata/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

VERSION = (1, 0, 0)
VERSION = (1, 0, 1)
PRERELEASE = None # alpha, beta or rc
REVISION = None

Expand Down
2 changes: 1 addition & 1 deletion adata/bond/info/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@time: 2023/5/31
@log: change log
"""
from .bond_code import BondCode
from adata.bond.info.bond_code import BondCode


class Info(BondCode):
Expand Down
13 changes: 7 additions & 6 deletions adata/common/utils/cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@time: 2023/5/5
@log: change log
"""
from importlib import resources
import os

from py_mini_racer import py_mini_racer

Expand All @@ -15,7 +15,7 @@ def ths_cookie(js_path="ths.js"):
js_code = py_mini_racer.MiniRacer()
js_content = get_file_content_ths(file_path=js_path)
js_code.eval(js_content)
return 'v=' + js_code.call("v")+";"
return 'v=' + js_code.call("v") + ";"


def get_file_content_ths(file_path: str = None) -> str:
Expand All @@ -24,10 +24,11 @@ def get_file_content_ths(file_path: str = None) -> str:
:param file_path: JS 文件名
:return: 文件内容
"""
with resources.path("adata.common.js", file_path) as f_path:
with open(f_path) as f:
file_data = f.read()
return file_data
_curpath = os.path.normpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
f_path = _curpath.replace('utils', 'js/') + file_path
with open(f_path) as f:
file_data = f.read()
return file_data


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion adata/fund/info/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@time: 2023/6/5
@log: change log
"""
from .fund_info import FundInfo
from adata.fund.info.fund_info import FundInfo


class Info(FundInfo):
Expand Down
6 changes: 3 additions & 3 deletions adata/stock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
@time: 2023/3/29
@log: change log
"""
from .index import index
from .info import info
from .market import market
from adata.stock.index import index
from adata.stock.info import info
from adata.stock.market import market


class Stock(object):
Expand Down
6 changes: 3 additions & 3 deletions adata/stock/info/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
@time: 2023/3/28
@log: change log
"""
from .stock_code import StockCode
from adata.stock.info.stock_code import StockCode
from adata.stock.info.concept.stock_concept import StockConcept
from .stock_index import StockIndex
from .trade_calendar import TradeCalendar
from adata.stock.info.stock_index import StockIndex
from adata.stock.info.trade_calendar import TradeCalendar


class Info(StockCode, StockConcept, TradeCalendar, StockIndex):
Expand Down
4 changes: 2 additions & 2 deletions adata/stock/market/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"""
from adata.stock.market.concepth_market import StockMarketConcept
from adata.stock.market.index_market.market_index import StockMarketIndex
from .stock_dividend import StockDividend
from .stock_market import StockMarket
from adata.stock.market.stock_dividend import StockDividend
from adata.stock.market.stock_market import StockMarket


class Market(StockMarket, StockMarketConcept, StockDividend, StockMarketIndex):
Expand Down
2 changes: 1 addition & 1 deletion adata/stock/market/stock_market/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
@time: 2023/6/19
@log: change log
"""
from .stock_market import StockMarket
from adata.stock.market.stock_market.stock_market import StockMarket

6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requests>=2.26.0
pandas>=1.5.0
beautifulsoup4>=4.11.2
requests>=2.16.0
pandas>=1.1.5
beautifulsoup4>=4.0.2
py_mini_racer>=0.6.0
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
readme = f.read()

requires = [
"requests>=2.22.0",
"pandas>=1.5.0",
"beautifulsoup4>=4.11.2",
"requests>=2.16.0",
"pandas>=1.1.5",
"beautifulsoup4>=4.0.2",
"py_mini_racer>=0.6.0",
]

Expand Down Expand Up @@ -50,7 +50,6 @@ def setup_package():
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
python_requires=">=3.7",
)

try:
Expand Down