diff --git a/.idea/csv-editor.xml b/.idea/csv-editor.xml deleted file mode 100644 index af8e228..0000000 --- a/.idea/csv-editor.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/data_source_mapping.xml b/.idea/data_source_mapping.xml new file mode 100644 index 0000000..c96c85c --- /dev/null +++ b/.idea/data_source_mapping.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/db-forest-config.xml b/.idea/db-forest-config.xml new file mode 100644 index 0000000..454b8f6 --- /dev/null +++ b/.idea/db-forest-config.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/data.py b/data.py new file mode 100644 index 0000000..a4dfe27 --- /dev/null +++ b/data.py @@ -0,0 +1,136 @@ +from datetime import date, datetime, timedelta +from time import sleep + +from sqlalchemy import Column, Double, Integer, String, create_engine +from sqlalchemy.orm import DeclarativeBase, Session +from tushare import pro_api + +TUSHARE_API_KEY = '64ebff4fa679167600b905ee45dd88e76f3963c0ff39157f3f085f0e' + + +class Base(DeclarativeBase): + pass + + +class Stock(Base): + __tablename__ = 'stock' + + code = Column(String, primary_key=True, comment="代码") + name = Column(String, comment="名称") + fullname = Column(String, comment="全名") + market = Column(String, comment="市场") + exchange = Column(String, comment="交易所") + industry = Column(String, comment="行业") + list_date = Column(String, comment="上市日期") + + +class Daily(Base): + __tablename__ = 'daily' + + code = Column(String, primary_key=True) + trade_date = Column(String, primary_key=True) + open = Column(Double) + close = Column(Double) + high = Column(Double) + low = Column(Double) + previous_close = Column(Double) + turnover = Column(Double) + volume = Column(Integer) + price_change_amount = Column(Double) + factor = Column(Double) + + +def main(): + print("开始更新数据") + + engine = create_engine(f"sqlite:////Users/lanyuanxiaoyao/Documents/leopard_data/leopard.sqlite") + try: + Stock.metadata.create_all(engine, checkfirst=True) + Daily.metadata.create_all(engine, checkfirst=True) + pro = pro_api(TUSHARE_API_KEY) + # with engine.connect() as connection: + # stocks = pro.stock_basic(list_status="L", market="主板", fields="ts_code,name,fullname,market,exchange,industry,list_date") + # for row in stocks.itertuples(): + # stmt = insert(Stock).values( + # code=row.ts_code, + # name=row.name, + # fullname=row.fullname, + # market=row.market, + # exchange=row.exchange, + # industry=row.industry, + # list_date=row.list_date, + # ) + # stmt = stmt.on_conflict_do_update( + # index_elements=["code"], + # set_={ + # "name": stmt.excluded.name, + # "fullname": stmt.excluded.fullname, + # "market": stmt.excluded.market, + # "exchange": stmt.excluded.exchange, + # "industry": stmt.excluded.industry, + # "list_date": stmt.excluded.list_date, + # }, + # ) + # print(stmt) + # connection.execute(stmt) + # connection.commit() + # + # print("清理行情数据") + # connection.execute(text("delete from daily where code not in (select distinct code from stock)")) + # connection.commit() + # + # print("清理财务数据") + # connection.execute(text("delete from finance_indicator where code not in (select distinct code from stock)")) + # connection.commit() + + with Session(engine) as session: + stock_codes = [row[0] for row in session.query(Stock.code).all()] + + latest_date = session.query(Daily.trade_date).order_by(Daily.trade_date.desc()).first() + if latest_date is None: + latest_date = '1990-12-19' + else: + latest_date = latest_date.trade_date + latest_date = datetime.strptime(latest_date, '%Y-%m-%d').date() + current_date = date.today() - timedelta(days=1) + delta = (current_date - latest_date).days + print(f"最新数据日期:{latest_date},当前日期:{current_date},待更新天数:{delta}") + if delta > 0: + update_dates = [] + for i in range(delta): + latest_date = latest_date + timedelta(days=1) + update_dates.append(latest_date.strftime('%Y%m%d')) + for target_date in update_dates: + print(f"正在采集:{target_date}") + dailies = pro.daily(trade_date=target_date) + dailies.set_index("ts_code", inplace=True) + factors = pro.adj_factor(trade_date=target_date) + factors.set_index("ts_code", inplace=True) + results = dailies.join(factors, lsuffix="_daily", rsuffix="_factor", how="left") + rows = [] + for row in results.itertuples(): + if row.Index in stock_codes: + rows.append( + Daily( + code=row.Index, + trade_date=datetime.strptime(target_date, '%Y%m%d').strftime("%Y-%m-%d"), + open=row.open, + close=row.close, + high=row.high, + low=row.low, + previous_close=row.pre_close, + turnover=row.amount, + volume=row.vol, + price_change_amount=row.pct_chg, + factor=row.adj_factor, + ) + ) + session.add_all(rows) + session.commit() + sleep(1) + finally: + engine.dispose() + + +if __name__ == '__main__': + main() diff --git a/notebook/datasource/data.ipynb b/notebook/datasource/data.ipynb new file mode 100644 index 0000000..a872a0a --- /dev/null +++ b/notebook/datasource/data.ipynb @@ -0,0 +1,1300 @@ +{ + "cells": [ + { + "cell_type": "code", + "id": "initial_id", + "metadata": { + "collapsed": true, + "ExecuteTime": { + "end_time": "2026-01-30T06:48:44.912513Z", + "start_time": "2026-01-30T06:48:44.785729Z" + } + }, + "source": [ + "import baostock as bs\n", + "import pandas as pd\n", + "\n", + "lg = bs.login()" + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "login success!\n" + ] + } + ], + "execution_count": 27 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T06:48:59.682551Z", + "start_time": "2026-01-30T06:48:59.515016Z" + } + }, + "cell_type": "code", + "source": [ + "rs = bs.query_history_k_data_plus(\n", + " \"sz.000001\",\n", + " \"date,code,open,high,low,close,preClose,volume,amount,turn,pctChg\",\n", + " start_date=\"1991-1-1\",\n", + " end_date=\"1992-1-1\",\n", + " adjustflag=\"1\",\n", + ")\n", + "data_list = []\n", + "while (rs.error_code == '0') & rs.next():\n", + " data_list.append(rs.get_row_data())\n", + "\n", + "df = pd.DataFrame(data_list, columns=rs.fields)\n", + "# df[\"code\"] = df.apply(lambda row: \".\".join(row[\"code\"].split(\".\")[::-1]).upper(), axis=1)\n", + "df" + ], + "id": "ed40fa92230584dc", + "outputs": [ + { + "data": { + "text/plain": [ + " date code open high low \\\n", + "0 1991-04-03 sz.000001 49.0000000000 49.0000000000 49.0000000000 \n", + "1 1991-04-04 sz.000001 48.7600000000 48.7600000000 48.7600000000 \n", + "2 1991-04-05 sz.000001 48.5200000000 48.5200000000 48.5200000000 \n", + "3 1991-04-08 sz.000001 48.0400000000 48.0400000000 48.0400000000 \n", + "4 1991-04-09 sz.000001 47.8000000000 47.8000000000 47.8000000000 \n", + ".. ... ... ... ... ... \n", + "187 1991-12-25 sz.000001 42.5415391500 43.7820300000 42.4685691000 \n", + "188 1991-12-26 sz.000001 42.7604493000 42.7604493000 40.8632280000 \n", + "189 1991-12-27 sz.000001 40.8632280000 41.5929285000 40.8632280000 \n", + "190 1991-12-30 sz.000001 42.7604493000 42.9063894000 42.0307488000 \n", + "191 1991-12-31 sz.000001 42.0307488000 42.8334193500 42.0307488000 \n", + "\n", + " close preClose volume amount turn pctChg \n", + "0 49.0000000000 40.0000000000 100 4900.0000 0.000270 22.500000 \n", + "1 48.7600000000 49.0000000000 300 14628.0000 0.000809 -0.489799 \n", + "2 48.5200000000 48.7600000000 200 9704.0000 0.000539 -0.492202 \n", + "3 48.0400000000 48.2800000000 200 9608.0000 0.000539 -0.497100 \n", + "4 47.8000000000 48.0400000000 400 19120.0000 0.001078 -0.499587 \n", + ".. ... ... ... ... ... ... \n", + "187 42.7604493000 42.3955990500 226900 6702870.0000 0.470454 0.860585 \n", + "188 40.8632280000 42.7604493000 191800 5509610.0000 0.397678 -4.436858 \n", + "189 41.5199584500 40.8632280000 210500 5935400.0000 0.436450 1.607146 \n", + "190 42.0307488000 42.6874792500 105900 3093085.0000 0.219573 -1.538462 \n", + "191 42.8334193500 42.0307488000 75900 2203915.0000 0.152534 1.909726 \n", + "\n", + "[192 rows x 11 columns]" + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
datecodeopenhighlowclosepreClosevolumeamountturnpctChg
01991-04-03sz.00000149.000000000049.000000000049.000000000049.000000000040.00000000001004900.00000.00027022.500000
11991-04-04sz.00000148.760000000048.760000000048.760000000048.760000000049.000000000030014628.00000.000809-0.489799
21991-04-05sz.00000148.520000000048.520000000048.520000000048.520000000048.76000000002009704.00000.000539-0.492202
31991-04-08sz.00000148.040000000048.040000000048.040000000048.040000000048.28000000002009608.00000.000539-0.497100
41991-04-09sz.00000147.800000000047.800000000047.800000000047.800000000048.040000000040019120.00000.001078-0.499587
....................................
1871991-12-25sz.00000142.541539150043.782030000042.468569100042.760449300042.39559905002269006702870.00000.4704540.860585
1881991-12-26sz.00000142.760449300042.760449300040.863228000040.863228000042.76044930001918005509610.00000.397678-4.436858
1891991-12-27sz.00000140.863228000041.592928500040.863228000041.519958450040.86322800002105005935400.00000.4364501.607146
1901991-12-30sz.00000142.760449300042.906389400042.030748800042.030748800042.68747925001059003093085.00000.219573-1.538462
1911991-12-31sz.00000142.030748800042.833419350042.030748800042.833419350042.0307488000759002203915.00000.1525341.909726
\n", + "

192 rows × 11 columns

\n", + "
" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 30 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T06:51:04.154374Z", + "start_time": "2026-01-30T06:51:04.096340Z" + } + }, + "cell_type": "code", + "source": [ + "for year in range(1990, 2025):\n", + " print(year)" + ], + "id": "cbb28b1f4857259e", + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1990\n", + "1991\n", + "1992\n", + "1993\n", + "1994\n", + "1995\n", + "1996\n", + "1997\n", + "1998\n", + "1999\n", + "2000\n", + "2001\n", + "2002\n", + "2003\n", + "2004\n", + "2005\n", + "2006\n", + "2007\n", + "2008\n", + "2009\n", + "2010\n", + "2011\n", + "2012\n", + "2013\n", + "2014\n", + "2015\n", + "2016\n", + "2017\n", + "2018\n", + "2019\n", + "2020\n", + "2021\n", + "2022\n", + "2023\n", + "2024\n" + ] + } + ], + "execution_count": 31 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T02:30:18.416075Z", + "start_time": "2026-01-30T02:30:18.255416Z" + } + }, + "cell_type": "code", + "source": [ + "rs = bs.query_stock_basic(code=\"sz.000001\")\n", + "data_list = []\n", + "while (rs.error_code == '0') & rs.next():\n", + " data_list.append(rs.get_row_data())\n", + "df = pd.DataFrame(data_list, columns=rs.fields)\n", + "df" + ], + "id": "3eb9e1033b4360ed", + "outputs": [ + { + "data": { + "text/plain": [ + " code code_name ipoDate outDate type status\n", + "0 sz.000001 平安银行 1991-04-03 1 1" + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
codecode_nameipoDateoutDatetypestatus
0sz.000001平安银行1991-04-0311
\n", + "
" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 8 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T02:17:09.614916Z", + "start_time": "2026-01-30T02:16:48.773160Z" + } + }, + "cell_type": "code", + "source": [ + "import adata\n", + "\n", + "adata.stock.info.all_code()" + ], + "id": "93a1d7caffc916c", + "outputs": [ + { + "data": { + "text/plain": [ + " stock_code short_name exchange list_date\n", + "0 000001 平安银行 SZ 1991-04-03\n", + "1 000002 万科A SZ 1991-01-29\n", + "2 000003 PT金田A SZ NaN\n", + "3 000004 *ST国华 SZ 1990-12-01\n", + "4 000005 ST星源 SZ 1990-12-10\n", + "... ... ... ... ...\n", + "5759 920978 开特股份 BJ 2023-09-28\n", + "5760 920981 晶赛科技 BJ 2021-11-15\n", + "5761 920982 锦波生物 BJ 2023-07-20\n", + "5762 920985 海泰新能 BJ 2022-08-08\n", + "5763 920992 中科美菱 BJ 2022-10-18\n", + "\n", + "[5764 rows x 4 columns]" + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
stock_codeshort_nameexchangelist_date
0000001平安银行SZ1991-04-03
1000002万科ASZ1991-01-29
2000003PT金田ASZNaN
3000004*ST国华SZ1990-12-01
4000005ST星源SZ1990-12-10
...............
5759920978开特股份BJ2023-09-28
5760920981晶赛科技BJ2021-11-15
5761920982锦波生物BJ2023-07-20
5762920985海泰新能BJ2022-08-08
5763920992中科美菱BJ2022-10-18
\n", + "

5764 rows × 4 columns

\n", + "
" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 2 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T02:23:11.398502Z", + "start_time": "2026-01-30T02:23:11.257663Z" + } + }, + "cell_type": "code", + "source": "adata.stock.market.get_market(stock_code='000001', start_date='2025-01-01', end_date='2025-12-31', adjust_type=0)", + "id": "c716caf5e7157b4f", + "outputs": [ + { + "data": { + "text/plain": [ + " stock_code trade_time trade_date open close high low \\\n", + "0 000001 2025-01-02 00:00:00 2025-01-02 11.73 11.43 11.77 11.39 \n", + "1 000001 2025-01-03 00:00:00 2025-01-03 11.44 11.38 11.54 11.36 \n", + "2 000001 2025-01-06 00:00:00 2025-01-06 11.38 11.44 11.48 11.22 \n", + "3 000001 2025-01-07 00:00:00 2025-01-07 11.42 11.51 11.53 11.37 \n", + "4 000001 2025-01-08 00:00:00 2025-01-08 11.50 11.50 11.63 11.40 \n", + ".. ... ... ... ... ... ... ... \n", + "238 000001 2025-12-25 00:00:00 2025-12-25 11.54 11.56 11.62 11.52 \n", + "239 000001 2025-12-26 00:00:00 2025-12-26 11.56 11.54 11.59 11.53 \n", + "240 000001 2025-12-29 00:00:00 2025-12-29 11.54 11.56 11.62 11.50 \n", + "241 000001 2025-12-30 00:00:00 2025-12-30 11.53 11.48 11.56 11.45 \n", + "242 000001 2025-12-31 00:00:00 2025-12-31 11.48 11.41 11.49 11.40 \n", + "\n", + " volume amount change_pct change turnover_ratio pre_close \n", + "0 181959700 2.102923e+09 -2.31 -0.27 0.94 11.70 \n", + "1 115468000 1.320521e+09 -0.44 -0.05 0.60 11.43 \n", + "2 108553600 1.234306e+09 0.53 0.06 0.56 11.38 \n", + "3 74786300 8.583290e+08 0.61 0.07 0.39 11.44 \n", + "4 106238600 1.223599e+09 -0.09 -0.01 0.55 11.51 \n", + ".. ... ... ... ... ... ... \n", + "238 54745500 6.337726e+08 0.17 0.02 0.28 11.54 \n", + "239 43634000 5.040793e+08 -0.17 -0.02 0.22 11.56 \n", + "240 64829500 7.490830e+08 0.17 0.02 0.33 11.54 \n", + "241 58258400 6.694093e+08 -0.69 -0.08 0.30 11.56 \n", + "242 59062000 6.754574e+08 -0.61 -0.07 0.30 11.48 \n", + "\n", + "[243 rows x 13 columns]" + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
stock_codetrade_timetrade_dateopenclosehighlowvolumeamountchange_pctchangeturnover_ratiopre_close
00000012025-01-02 00:00:002025-01-0211.7311.4311.7711.391819597002.102923e+09-2.31-0.270.9411.70
10000012025-01-03 00:00:002025-01-0311.4411.3811.5411.361154680001.320521e+09-0.44-0.050.6011.43
20000012025-01-06 00:00:002025-01-0611.3811.4411.4811.221085536001.234306e+090.530.060.5611.38
30000012025-01-07 00:00:002025-01-0711.4211.5111.5311.37747863008.583290e+080.610.070.3911.44
40000012025-01-08 00:00:002025-01-0811.5011.5011.6311.401062386001.223599e+09-0.09-0.010.5511.51
..........................................
2380000012025-12-25 00:00:002025-12-2511.5411.5611.6211.52547455006.337726e+080.170.020.2811.54
2390000012025-12-26 00:00:002025-12-2611.5611.5411.5911.53436340005.040793e+08-0.17-0.020.2211.56
2400000012025-12-29 00:00:002025-12-2911.5411.5611.6211.50648295007.490830e+080.170.020.3311.54
2410000012025-12-30 00:00:002025-12-3011.5311.4811.5611.45582584006.694093e+08-0.69-0.080.3011.56
2420000012025-12-31 00:00:002025-12-3111.4811.4111.4911.40590620006.754574e+08-0.61-0.070.3011.48
\n", + "

243 rows × 13 columns

\n", + "
" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 6 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T07:20:29.946256Z", + "start_time": "2026-01-30T07:20:29.785116Z" + } + }, + "cell_type": "code", + "source": [ + "import akshare as ak\n", + "\n", + "ak.stock_individual_info_em(symbol='600000')" + ], + "id": "f7667bf80cc8c02", + "outputs": [ + { + "data": { + "text/plain": [ + " item value\n", + "0 最新 10.04\n", + "1 股票代码 600000\n", + "2 股票简称 浦发银行\n", + "3 总股本 33305838300.0\n", + "4 流通股 33305838300.0\n", + "5 总市值 334390616532.0\n", + "6 流通市值 334390616532.0\n", + "7 行业 银行\n", + "8 上市时间 19991110" + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
itemvalue
0最新10.04
1股票代码600000
2股票简称浦发银行
3总股本33305838300.0
4流通股33305838300.0
5总市值334390616532.0
6流通市值334390616532.0
7行业银行
8上市时间19991110
\n", + "
" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 38 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T07:23:53.711254Z", + "start_time": "2026-01-30T07:23:53.490571Z" + } + }, + "cell_type": "code", + "source": "ak.stock_individual_basic_info_xq(symbol='SH600005')", + "id": "d58638d8a8b269e7", + "outputs": [ + { + "data": { + "text/plain": [ + " item \\\n", + "0 org_id \n", + "1 org_name_cn \n", + "2 org_short_name_cn \n", + "3 org_name_en \n", + "4 org_short_name_en \n", + "5 main_operation_business \n", + "6 operating_scope \n", + "7 district_encode \n", + "8 org_cn_introduction \n", + "9 legal_representative \n", + "10 general_manager \n", + "11 secretary \n", + "12 established_date \n", + "13 reg_asset \n", + "14 staff_num \n", + "15 telephone \n", + "16 postcode \n", + "17 fax \n", + "18 email \n", + "19 org_website \n", + "20 reg_address_cn \n", + "21 reg_address_en \n", + "22 office_address_cn \n", + "23 office_address_en \n", + "24 currency_encode \n", + "25 currency \n", + "26 listed_date \n", + "27 provincial_name \n", + "28 actual_controller \n", + "29 classi_name \n", + "30 pre_name_cn \n", + "31 chairman \n", + "32 executives_nums \n", + "33 actual_issue_vol \n", + "34 issue_price \n", + "35 actual_rc_net_amt \n", + "36 pe_after_issuing \n", + "37 online_success_rate_of_issue \n", + "38 affiliate_industry \n", + "\n", + " value \n", + "0 02600005 \n", + "1 武汉钢铁股份有限公司 \n", + "2 武钢股份 \n", + "3 Wuhan Iron And Steel Company Limited \n", + "4 WISCO,Ltd. \n", + "5 冶金产品及副产品、钢铁延伸产品制造及冶金产品的技术开发 \n", + "6   冶金产品及副产品、钢铁延伸产品制造;冶金产品的技术开发;钢铁及副产品的销售;货物进出口、... \n", + "7 420107 \n", + "8 武汉钢铁股份有限公司是由武汉钢铁集团公司控股的、国内第二大钢铁上市公司.是一家主要经营钢铁生... \n", + "9 马国强 \n", + "10 邹继新 \n", + "11 李海涛 \n", + "12 878832000000 \n", + "13 10093780000.0 \n", + "14 27328 \n", + "15 86-27-86217195 \n", + "16 430083 \n", + "17 86-27-86217296 \n", + "18 wiscl@wisco.com.cn \n", + "19 www.wisco.com.cn \n", + "20 湖北省武汉市青山区厂前街(青山区股份公司机关) \n", + "21 None \n", + "22 湖北省武汉市青山区厂前武钢2号门 \n", + "23 None \n", + "24 019001 \n", + "25 CNY \n", + "26 933609600000 \n", + "27 湖北省 \n", + "28 国务院国有资产监督管理委员会 (52.76%) \n", + "29 央企国资控股 \n", + "30 None \n", + "31 邹继新 \n", + "32 5 \n", + "33 320000000.0 \n", + "34 4.3 \n", + "35 1349051600.0 \n", + "36 14.1 \n", + "37 4.923 \n", + "38 None " + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
itemvalue
0org_id02600005
1org_name_cn武汉钢铁股份有限公司
2org_short_name_cn武钢股份
3org_name_enWuhan Iron And Steel Company Limited
4org_short_name_enWISCO,Ltd.
5main_operation_business冶金产品及副产品、钢铁延伸产品制造及冶金产品的技术开发
6operating_scope冶金产品及副产品、钢铁延伸产品制造;冶金产品的技术开发;钢铁及副产品的销售;货物进出口、...
7district_encode420107
8org_cn_introduction武汉钢铁股份有限公司是由武汉钢铁集团公司控股的、国内第二大钢铁上市公司.是一家主要经营钢铁生...
9legal_representative马国强
10general_manager邹继新
11secretary李海涛
12established_date878832000000
13reg_asset10093780000.0
14staff_num27328
15telephone86-27-86217195
16postcode430083
17fax86-27-86217296
18emailwiscl@wisco.com.cn
19org_websitewww.wisco.com.cn
20reg_address_cn湖北省武汉市青山区厂前街(青山区股份公司机关)
21reg_address_enNone
22office_address_cn湖北省武汉市青山区厂前武钢2号门
23office_address_enNone
24currency_encode019001
25currencyCNY
26listed_date933609600000
27provincial_name湖北省
28actual_controller国务院国有资产监督管理委员会 (52.76%)
29classi_name央企国资控股
30pre_name_cnNone
31chairman邹继新
32executives_nums5
33actual_issue_vol320000000.0
34issue_price4.3
35actual_rc_net_amt1349051600.0
36pe_after_issuing14.1
37online_success_rate_of_issue4.923
38affiliate_industryNone
\n", + "
" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 41 + }, + { + "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, + "source": "", + "id": "f624320cab54d22" + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebook/datasource/data_old.ipynb b/notebook/datasource/data_old.ipynb index 0c8dad1..b65522a 100644 --- a/notebook/datasource/data_old.ipynb +++ b/notebook/datasource/data_old.ipynb @@ -3,8 +3,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-01-29T10:09:22.171634Z", - "start_time": "2026-01-29T08:27:03.148937Z" + "end_time": "2026-01-30T05:41:51.291397Z", + "start_time": "2026-01-30T04:34:22.917761Z" } }, "cell_type": "code", @@ -13,6 +13,7 @@ "\n", "import pandas as pd\n", "import sqlalchemy\n", + "from sqlalchemy import text\n", "from sqlalchemy.orm import DeclarativeBase, Session\n", "\n", "postgresql_engin = sqlalchemy.create_engine(\n", @@ -29,7 +30,7 @@ " __tablename__ = 'daily'\n", "\n", " code = sqlalchemy.Column(sqlalchemy.String, primary_key=True)\n", - " trade_date = sqlalchemy.Column(sqlalchemy.Date)\n", + " trade_date = sqlalchemy.Column(sqlalchemy.Date, primary_key=True)\n", " open = sqlalchemy.Column(sqlalchemy.Double)\n", " close = sqlalchemy.Column(sqlalchemy.Double)\n", " high = sqlalchemy.Column(sqlalchemy.Double)\n", @@ -42,47 +43,52 @@ "\n", "\n", "try:\n", - " stock_df = pd.read_sql_table(\"stock\", sqlite_engine)\n", - " for index, code in enumerate(stock_df[\"code\"]):\n", - " print(code)\n", - " daily_df = pd.read_sql(\n", - " f\"\"\"\n", - " select code,\n", - " trade_date,\n", - " open,\n", - " close,\n", - " high,\n", - " low,\n", - " previous_close,\n", - " turnover,\n", - " volume,\n", - " price_change_amount,\n", - " factor\n", - " from leopard_daily d\n", - " left join leopard_stock s on d.stock_id = s.id\n", - " where s.code = '{code}'\n", - " \"\"\",\n", - " postgresql_engin\n", - " )\n", - " with Session(sqlite_engine) as session:\n", - " for _, row in daily_df.iterrows():\n", - " session.add(\n", - " Daily(\n", - " code=row[\"code\"],\n", - " trade_date=row[\"trade_date\"],\n", - " open=row[\"open\"],\n", - " close=row[\"close\"],\n", - " high=row[\"high\"],\n", - " low=row[\"low\"],\n", - " previous_close=row[\"previous_close\"],\n", - " turnover=row[\"turnover\"],\n", - " volume=row[\"volume\"],\n", - " price_change_amount=row[\"price_change_amount\"],\n", - " factor=row[\"factor\"]\n", + " with Session(postgresql_engin) as pg_session:\n", + " results = pg_session.execute(text(\"select distinct trade_date from leopard_daily\")).fetchall()\n", + " results = list(map(lambda x: x[0].strftime(\"%Y-%m-%d\"), results))\n", + " dates = [results[i: i + 30] for i in range(0, len(results), 30)]\n", + "\n", + " for index, date in enumerate(dates):\n", + " print(date)\n", + " daily_df = pd.read_sql(\n", + " f\"\"\"\n", + " select code,\n", + " trade_date,\n", + " open,\n", + " close,\n", + " high,\n", + " low,\n", + " previous_close,\n", + " turnover,\n", + " volume,\n", + " price_change_amount,\n", + " factor\n", + " from leopard_daily d\n", + " left join leopard_stock s on d.stock_id = s.id\n", + " where d.trade_date in ('{\"','\".join(date)}')\n", + " \"\"\",\n", + " postgresql_engin\n", + " )\n", + " with Session(sqlite_engine) as session:\n", + " rows = []\n", + " for _, row in daily_df.iterrows():\n", + " rows.append(\n", + " Daily(\n", + " code=row[\"code\"],\n", + " trade_date=row[\"trade_date\"],\n", + " open=row[\"open\"],\n", + " close=row[\"close\"],\n", + " high=row[\"high\"],\n", + " low=row[\"low\"],\n", + " previous_close=row[\"previous_close\"],\n", + " turnover=row[\"turnover\"],\n", + " volume=row[\"volume\"],\n", + " price_change_amount=row[\"price_change_amount\"],\n", + " factor=row[\"factor\"]\n", + " )\n", " )\n", - " )\n", - " session.flush()\n", - " session.commit()\n", + " session.add_all(rows)\n", + " session.commit()\n", "finally:\n", " postgresql_engin.dispose()\n", " sqlite_engine.dispose()" @@ -90,28 +96,339 @@ "id": "48821306efc640a1", "outputs": [ { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001B[31m---------------------------------------------------------------------------\u001B[39m", - "\u001B[31mKeyboardInterrupt\u001B[39m Traceback (most recent call last)", - "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[26]\u001B[39m\u001B[32m, line 37\u001B[39m\n\u001B[32m 35\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m index, code \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28menumerate\u001B[39m(stock_df[\u001B[33m\"\u001B[39m\u001B[33mcode\u001B[39m\u001B[33m\"\u001B[39m]):\n\u001B[32m 36\u001B[39m \u001B[38;5;28mprint\u001B[39m(code)\n\u001B[32m---> \u001B[39m\u001B[32m37\u001B[39m daily_df = \u001B[43mpd\u001B[49m\u001B[43m.\u001B[49m\u001B[43mread_sql\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 38\u001B[39m \u001B[43m \u001B[49m\u001B[33;43mf\u001B[39;49m\u001B[33;43m\"\"\"\u001B[39;49m\n\u001B[32m 39\u001B[39m \u001B[33;43m select code,\u001B[39;49m\n\u001B[32m 40\u001B[39m \u001B[33;43m trade_date,\u001B[39;49m\n\u001B[32m 41\u001B[39m \u001B[33;43m open,\u001B[39;49m\n\u001B[32m 42\u001B[39m \u001B[33;43m close,\u001B[39;49m\n\u001B[32m 43\u001B[39m \u001B[33;43m high,\u001B[39;49m\n\u001B[32m 44\u001B[39m \u001B[33;43m low,\u001B[39;49m\n\u001B[32m 45\u001B[39m \u001B[33;43m previous_close,\u001B[39;49m\n\u001B[32m 46\u001B[39m \u001B[33;43m turnover,\u001B[39;49m\n\u001B[32m 47\u001B[39m \u001B[33;43m volume,\u001B[39;49m\n\u001B[32m 48\u001B[39m \u001B[33;43m price_change_amount,\u001B[39;49m\n\u001B[32m 49\u001B[39m \u001B[33;43m factor\u001B[39;49m\n\u001B[32m 50\u001B[39m \u001B[33;43m from leopard_daily d\u001B[39;49m\n\u001B[32m 51\u001B[39m \u001B[33;43m left join leopard_stock s on d.stock_id = s.id\u001B[39;49m\n\u001B[32m 52\u001B[39m \u001B[33;43m where s.code = \u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[38;5;132;43;01m{\u001B[39;49;00m\u001B[43mcode\u001B[49m\u001B[38;5;132;43;01m}\u001B[39;49;00m\u001B[33;43m'\u001B[39;49m\n\u001B[32m 53\u001B[39m \u001B[33;43m \u001B[39;49m\u001B[33;43m\"\"\"\u001B[39;49m\u001B[43m,\u001B[49m\n\u001B[32m 54\u001B[39m \u001B[43m \u001B[49m\u001B[43mpostgresql_engin\u001B[49m\n\u001B[32m 55\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 56\u001B[39m \u001B[38;5;28;01mwith\u001B[39;00m Session(sqlite_engine) \u001B[38;5;28;01mas\u001B[39;00m session:\n\u001B[32m 57\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m _, row \u001B[38;5;129;01min\u001B[39;00m daily_df.iterrows():\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/pandas/io/sql.py:736\u001B[39m, in \u001B[36mread_sql\u001B[39m\u001B[34m(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize, dtype_backend, dtype)\u001B[39m\n\u001B[32m 726\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m pandas_sql.read_table(\n\u001B[32m 727\u001B[39m sql,\n\u001B[32m 728\u001B[39m index_col=index_col,\n\u001B[32m (...)\u001B[39m\u001B[32m 733\u001B[39m dtype_backend=dtype_backend,\n\u001B[32m 734\u001B[39m )\n\u001B[32m 735\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m736\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mpandas_sql\u001B[49m\u001B[43m.\u001B[49m\u001B[43mread_query\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 737\u001B[39m \u001B[43m \u001B[49m\u001B[43msql\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 738\u001B[39m \u001B[43m \u001B[49m\u001B[43mindex_col\u001B[49m\u001B[43m=\u001B[49m\u001B[43mindex_col\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 739\u001B[39m \u001B[43m \u001B[49m\u001B[43mparams\u001B[49m\u001B[43m=\u001B[49m\u001B[43mparams\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 740\u001B[39m \u001B[43m \u001B[49m\u001B[43mcoerce_float\u001B[49m\u001B[43m=\u001B[49m\u001B[43mcoerce_float\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 741\u001B[39m \u001B[43m \u001B[49m\u001B[43mparse_dates\u001B[49m\u001B[43m=\u001B[49m\u001B[43mparse_dates\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 742\u001B[39m \u001B[43m \u001B[49m\u001B[43mchunksize\u001B[49m\u001B[43m=\u001B[49m\u001B[43mchunksize\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 743\u001B[39m \u001B[43m \u001B[49m\u001B[43mdtype_backend\u001B[49m\u001B[43m=\u001B[49m\u001B[43mdtype_backend\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 744\u001B[39m \u001B[43m \u001B[49m\u001B[43mdtype\u001B[49m\u001B[43m=\u001B[49m\u001B[43mdtype\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 745\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/pandas/io/sql.py:1848\u001B[39m, in \u001B[36mSQLDatabase.read_query\u001B[39m\u001B[34m(self, sql, index_col, coerce_float, parse_dates, params, chunksize, dtype, dtype_backend)\u001B[39m\n\u001B[32m 1791\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34mread_query\u001B[39m(\n\u001B[32m 1792\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m 1793\u001B[39m sql: \u001B[38;5;28mstr\u001B[39m,\n\u001B[32m (...)\u001B[39m\u001B[32m 1800\u001B[39m dtype_backend: DtypeBackend | Literal[\u001B[33m\"\u001B[39m\u001B[33mnumpy\u001B[39m\u001B[33m\"\u001B[39m] = \u001B[33m\"\u001B[39m\u001B[33mnumpy\u001B[39m\u001B[33m\"\u001B[39m,\n\u001B[32m 1801\u001B[39m ) -> DataFrame | Iterator[DataFrame]:\n\u001B[32m 1802\u001B[39m \u001B[38;5;250m \u001B[39m\u001B[33;03m\"\"\"\u001B[39;00m\n\u001B[32m 1803\u001B[39m \u001B[33;03m Read SQL query into a DataFrame.\u001B[39;00m\n\u001B[32m 1804\u001B[39m \n\u001B[32m (...)\u001B[39m\u001B[32m 1846\u001B[39m \n\u001B[32m 1847\u001B[39m \u001B[33;03m \"\"\"\u001B[39;00m\n\u001B[32m-> \u001B[39m\u001B[32m1848\u001B[39m result = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mexecute\u001B[49m\u001B[43m(\u001B[49m\u001B[43msql\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mparams\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1849\u001B[39m columns = result.keys()\n\u001B[32m 1851\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m chunksize \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/pandas/io/sql.py:1671\u001B[39m, in \u001B[36mSQLDatabase.execute\u001B[39m\u001B[34m(self, sql, params)\u001B[39m\n\u001B[32m 1669\u001B[39m args = [] \u001B[38;5;28;01mif\u001B[39;00m params \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m \u001B[38;5;28;01melse\u001B[39;00m [params]\n\u001B[32m 1670\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(sql, \u001B[38;5;28mstr\u001B[39m):\n\u001B[32m-> \u001B[39m\u001B[32m1671\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mcon\u001B[49m\u001B[43m.\u001B[49m\u001B[43mexec_driver_sql\u001B[49m\u001B[43m(\u001B[49m\u001B[43msql\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1672\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m.con.execute(sql, *args)\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:1779\u001B[39m, in \u001B[36mConnection.exec_driver_sql\u001B[39m\u001B[34m(self, statement, parameters, execution_options)\u001B[39m\n\u001B[32m 1774\u001B[39m execution_options = \u001B[38;5;28mself\u001B[39m._execution_options.merge_with(\n\u001B[32m 1775\u001B[39m execution_options\n\u001B[32m 1776\u001B[39m )\n\u001B[32m 1778\u001B[39m dialect = \u001B[38;5;28mself\u001B[39m.dialect\n\u001B[32m-> \u001B[39m\u001B[32m1779\u001B[39m ret = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_execute_context\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1780\u001B[39m \u001B[43m \u001B[49m\u001B[43mdialect\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1781\u001B[39m \u001B[43m \u001B[49m\u001B[43mdialect\u001B[49m\u001B[43m.\u001B[49m\u001B[43mexecution_ctx_cls\u001B[49m\u001B[43m.\u001B[49m\u001B[43m_init_statement\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1782\u001B[39m \u001B[43m \u001B[49m\u001B[43mstatement\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1783\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43;01mNone\u001B[39;49;00m\u001B[43m,\u001B[49m\n\u001B[32m 1784\u001B[39m \u001B[43m \u001B[49m\u001B[43mexecution_options\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1785\u001B[39m \u001B[43m \u001B[49m\u001B[43mstatement\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1786\u001B[39m \u001B[43m \u001B[49m\u001B[43mdistilled_parameters\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1787\u001B[39m \u001B[43m\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1789\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m ret\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:1846\u001B[39m, in \u001B[36mConnection._execute_context\u001B[39m\u001B[34m(self, dialect, constructor, statement, parameters, execution_options, *args, **kw)\u001B[39m\n\u001B[32m 1844\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m._exec_insertmany_context(dialect, context)\n\u001B[32m 1845\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m-> \u001B[39m\u001B[32m1846\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_exec_single_context\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1847\u001B[39m \u001B[43m \u001B[49m\u001B[43mdialect\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontext\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstatement\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mparameters\u001B[49m\n\u001B[32m 1848\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:1986\u001B[39m, in \u001B[36mConnection._exec_single_context\u001B[39m\u001B[34m(self, dialect, context, statement, parameters)\u001B[39m\n\u001B[32m 1983\u001B[39m result = context._setup_result_proxy()\n\u001B[32m 1985\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mBaseException\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m e:\n\u001B[32m-> \u001B[39m\u001B[32m1986\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_handle_dbapi_exception\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1987\u001B[39m \u001B[43m \u001B[49m\u001B[43me\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstr_statement\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43meffective_parameters\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcursor\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontext\u001B[49m\n\u001B[32m 1988\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1990\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m result\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:2366\u001B[39m, in \u001B[36mConnection._handle_dbapi_exception\u001B[39m\u001B[34m(self, e, statement, parameters, cursor, context, is_sub_exec)\u001B[39m\n\u001B[32m 2364\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m 2365\u001B[39m \u001B[38;5;28;01massert\u001B[39;00m exc_info[\u001B[32m1\u001B[39m] \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m\n\u001B[32m-> \u001B[39m\u001B[32m2366\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m exc_info[\u001B[32m1\u001B[39m].with_traceback(exc_info[\u001B[32m2\u001B[39m])\n\u001B[32m 2367\u001B[39m \u001B[38;5;28;01mfinally\u001B[39;00m:\n\u001B[32m 2368\u001B[39m \u001B[38;5;28;01mdel\u001B[39;00m \u001B[38;5;28mself\u001B[39m._reentrant_error\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:1967\u001B[39m, in \u001B[36mConnection._exec_single_context\u001B[39m\u001B[34m(self, dialect, context, statement, parameters)\u001B[39m\n\u001B[32m 1965\u001B[39m \u001B[38;5;28;01mbreak\u001B[39;00m\n\u001B[32m 1966\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m evt_handled:\n\u001B[32m-> \u001B[39m\u001B[32m1967\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mdialect\u001B[49m\u001B[43m.\u001B[49m\u001B[43mdo_execute\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1968\u001B[39m \u001B[43m \u001B[49m\u001B[43mcursor\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstr_statement\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43meffective_parameters\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontext\u001B[49m\n\u001B[32m 1969\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1971\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m._has_events \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m.engine._has_events:\n\u001B[32m 1972\u001B[39m \u001B[38;5;28mself\u001B[39m.dispatch.after_cursor_execute(\n\u001B[32m 1973\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m 1974\u001B[39m cursor,\n\u001B[32m (...)\u001B[39m\u001B[32m 1978\u001B[39m context.executemany,\n\u001B[32m 1979\u001B[39m )\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/Project/leopard_analysis/.venv/lib/python3.14/site-packages/sqlalchemy/engine/default.py:952\u001B[39m, in \u001B[36mDefaultDialect.do_execute\u001B[39m\u001B[34m(self, cursor, statement, parameters, context)\u001B[39m\n\u001B[32m 951\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34mdo_execute\u001B[39m(\u001B[38;5;28mself\u001B[39m, cursor, statement, parameters, context=\u001B[38;5;28;01mNone\u001B[39;00m):\n\u001B[32m--> \u001B[39m\u001B[32m952\u001B[39m \u001B[43mcursor\u001B[49m\u001B[43m.\u001B[49m\u001B[43mexecute\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstatement\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mparameters\u001B[49m\u001B[43m)\u001B[49m\n", - "\u001B[36mFile \u001B[39m\u001B[32m~/.local/share/uv/python/cpython-3.14.2-macos-x86_64-none/lib/python3.14/encodings/utf_8.py:15\u001B[39m, in \u001B[36mdecode\u001B[39m\u001B[34m(input, errors)\u001B[39m\n\u001B[32m 11\u001B[39m \u001B[38;5;66;03m### Codec APIs\u001B[39;00m\n\u001B[32m 13\u001B[39m encode = codecs.utf_8_encode\n\u001B[32m---> \u001B[39m\u001B[32m15\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34mdecode\u001B[39m(\u001B[38;5;28minput\u001B[39m, errors=\u001B[33m'\u001B[39m\u001B[33mstrict\u001B[39m\u001B[33m'\u001B[39m):\n\u001B[32m 16\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m codecs.utf_8_decode(\u001B[38;5;28minput\u001B[39m, errors, \u001B[38;5;28;01mTrue\u001B[39;00m)\n\u001B[32m 18\u001B[39m \u001B[38;5;28;01mclass\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mIncrementalEncoder\u001B[39;00m(codecs.IncrementalEncoder):\n", - "\u001B[31mKeyboardInterrupt\u001B[39m: " + "name": "stdout", + "output_type": "stream", + "text": [ + "['2025-12-25', '2025-12-26', '2025-12-29', '2025-12-30', '2025-12-31', '2026-01-05', '2026-01-06', '2026-01-07', '2026-01-08', '2026-01-09']\n" ] } ], - "execution_count": 26 + "execution_count": 22 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T09:24:09.859231Z", + "start_time": "2026-01-30T09:24:09.746912Z" + } + }, + "cell_type": "code", + "source": [ + "import tushare as ts\n", + "\n", + "pro = ts.pro_api(\"64ebff4fa679167600b905ee45dd88e76f3963c0ff39157f3f085f0e\")\n", + "# stocks = pro.stock_basic(ts_code=\"600200.SH\", list_status=\"D\", fields=\"ts_code,name,fullname,market,exchange,industry,list_date,delist_date\")\n", + "# stocks" + ], + "id": "ed58a1faaf2cdb8e", + "outputs": [], + "execution_count": 34 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T07:14:29.897120Z", + "start_time": "2026-01-30T07:14:29.664124Z" + } + }, + "cell_type": "code", + "source": "# stocks.to_csv(\"dlist.csv\")", + "id": "3c8c0a38d6b2992e", + "outputs": [], + "execution_count": 24 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T09:46:34.808300Z", + "start_time": "2026-01-30T09:46:34.129412Z" + } + }, + "cell_type": "code", + "source": [ + "daily_df = pro.daily(trade_date=\"20251231\")\n", + "daily_df.set_index(\"ts_code\", inplace=True)\n", + "factor_df = pro.adj_factor(trade_date=\"20251231\")\n", + "factor_df.set_index(\"ts_code\", inplace=True)" + ], + "id": "c052a945869aa329", + "outputs": [], + "execution_count": 50 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-01-30T09:46:36.697015Z", + "start_time": "2026-01-30T09:46:36.642975Z" + } + }, + "cell_type": "code", + "source": [ + "result_df = daily_df.join(factor_df, lsuffix=\"_daily\", rsuffix=\"_factor\", how=\"left\")\n", + "result_df\n", + "# factor_df" + ], + "id": "d61ee80d2cd9f06b", + "outputs": [ + { + "data": { + "text/plain": [ + " trade_date_daily open high low close pre_close change \\\n", + "ts_code \n", + "000001.SZ 20251231 11.48 11.49 11.40 11.41 11.48 -0.07 \n", + "000002.SZ 20251231 4.66 4.68 4.62 4.65 4.62 0.03 \n", + "000004.SZ 20251231 11.30 11.35 11.07 11.08 11.27 -0.19 \n", + "000006.SZ 20251231 9.95 10.03 9.69 9.95 9.86 0.09 \n", + "000007.SZ 20251231 11.72 11.75 11.28 11.44 11.62 -0.18 \n", + "... ... ... ... ... ... ... ... \n", + "920978.BJ 20251231 37.64 38.39 36.88 36.90 37.78 -0.88 \n", + "920981.BJ 20251231 32.20 32.29 31.75 31.96 32.07 -0.11 \n", + "920982.BJ 20251231 233.00 238.49 232.10 233.70 234.80 -1.10 \n", + "920985.BJ 20251231 7.32 7.35 7.17 7.19 7.30 -0.11 \n", + "920992.BJ 20251231 17.33 17.60 17.29 17.39 17.38 0.01 \n", + "\n", + " pct_chg vol amount trade_date_factor adj_factor \n", + "ts_code \n", + "000001.SZ -0.6098 590620.37 675457.357 20251231 134.5794 \n", + "000002.SZ 0.6494 1075561.25 499883.113 20251231 181.7040 \n", + "000004.SZ -1.6859 18056.00 20248.567 20251231 4.0640 \n", + "000006.SZ 0.9128 270369.08 267758.676 20251231 39.7400 \n", + "000007.SZ -1.5491 80556.00 92109.366 20251231 8.2840 \n", + "... ... ... ... ... ... \n", + "920978.BJ -2.3293 33945.04 126954.937 20251231 1.2885 \n", + "920981.BJ -0.3430 8237.16 26301.206 20251231 1.4343 \n", + "920982.BJ -0.4685 5210.09 122452.646 20251231 4.2831 \n", + "920985.BJ -1.5068 35174.30 25350.257 20251231 1.6280 \n", + "920992.BJ 0.0575 6991.87 12193.445 20251231 1.4932 \n", + "\n", + "[5458 rows x 12 columns]" + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
trade_date_dailyopenhighlowclosepre_closechangepct_chgvolamounttrade_date_factoradj_factor
ts_code
000001.SZ2025123111.4811.4911.4011.4111.48-0.07-0.6098590620.37675457.35720251231134.5794
000002.SZ202512314.664.684.624.654.620.030.64941075561.25499883.11320251231181.7040
000004.SZ2025123111.3011.3511.0711.0811.27-0.19-1.685918056.0020248.567202512314.0640
000006.SZ202512319.9510.039.699.959.860.090.9128270369.08267758.6762025123139.7400
000007.SZ2025123111.7211.7511.2811.4411.62-0.18-1.549180556.0092109.366202512318.2840
.......................................
920978.BJ2025123137.6438.3936.8836.9037.78-0.88-2.329333945.04126954.937202512311.2885
920981.BJ2025123132.2032.2931.7531.9632.07-0.11-0.34308237.1626301.206202512311.4343
920982.BJ20251231233.00238.49232.10233.70234.80-1.10-0.46855210.09122452.646202512314.2831
920985.BJ202512317.327.357.177.197.30-0.11-1.506835174.3025350.257202512311.6280
920992.BJ2025123117.3317.6017.2917.3917.380.010.05756991.8712193.445202512311.4932
\n", + "

5458 rows × 12 columns

\n", + "
" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 51 } ], "metadata": { diff --git a/notebook/sqlalchemy.ipynb b/notebook/sqlalchemy.ipynb new file mode 100644 index 0000000..2eae745 --- /dev/null +++ b/notebook/sqlalchemy.ipynb @@ -0,0 +1,82 @@ +{ + "cells": [ + { + "cell_type": "code", + "id": "initial_id", + "metadata": { + "collapsed": true, + "ExecuteTime": { + "end_time": "2026-01-30T01:34:39.234530Z", + "start_time": "2026-01-30T01:34:39.002346Z" + } + }, + "source": [ + "from sqlalchemy import Column, Date, Double, Integer, String, create_engine\n", + "from sqlalchemy.orm import DeclarativeBase, Session\n", + "\n", + "engine = create_engine(f\"sqlite:////Users/lanyuanxiaoyao/Documents/leopard_data/leopard.sqlite\")\n", + "\n", + "\n", + "class Base(DeclarativeBase):\n", + " pass\n", + "\n", + "\n", + "class Daily(Base):\n", + " __tablename__ = 'daily'\n", + "\n", + " code = Column(String, nullable=False, primary_key=True)\n", + " trade_date = Column(Date, primary_key=True)\n", + " open = Column(Double)\n", + " close = Column(Double)\n", + " high = Column(Double)\n", + " low = Column(Double)\n", + " previous_close = Column(Double)\n", + " turnover = Column(Double)\n", + " volume = Column(Integer)\n", + " price_change_amount = Column(Double)\n", + " factor = Column(Double)\n", + "\n", + " def __repr__(self):\n", + " return f\"\"\n", + "\n", + "\n", + "Base.metadata.create_all(engine, checkfirst=True)\n", + "\n", + "with Session(engine) as session:\n", + " result = session.query(Daily).filter(Daily.code.in_([\"000001.SZ\"])).all()\n", + " print(result)" + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ]\n" + ] + } + ], + "execution_count": 26 + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/pyproject.toml b/pyproject.toml index 9049893..4ee6c2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,8 +4,10 @@ version = "0.1.0" description = "Stock analysis" requires-python = ">=3.14" dependencies = [ + "adata>=2.9.5", "akshare>=1.18.20", "backtesting~=0.6.5", + "baostock>=0.8.9", "duckdb>=1.4.4", "jupyter~=1.1.1", "jupyter-bokeh>=4.0.5", diff --git a/sql/initial.sql b/sql/initial.sql index 8170d8e..79eea31 100644 --- a/sql/initial.sql +++ b/sql/initial.sql @@ -1,11 +1,13 @@ CREATE TABLE stock ( - code varchar primary key, + code varchar not null, + name varchar not null, fullname varchar, industry varchar, listed_date date, market varchar, - name varchar + exchange varchar, + primary key (code) ); @@ -13,22 +15,22 @@ CREATE TABLE daily ( code varchar not null, trade_date date not null, - open double not null, - close double not null, - high double not null, - low double not null, - previous_close double not null, - turnover double not null, - volume integer not null, - price_change_amount double not null, - factor double not null, + open double, + close double, + high double, + low double, + previous_close double, + turnover double, + volume integer, + price_change_amount double, + factor double, primary key (code, trade_date) ); CREATE TABLE finance_indicator ( - code varchar, - year integer, + code varchar not null, + year integer not null, accounts_payable double, accounts_payable_to_total_assets_ratio double, accounts_receivable double, diff --git a/uv.lock b/uv.lock index 691390e..a02fe6e 100644 --- a/uv.lock +++ b/uv.lock @@ -2,6 +2,21 @@ version = 1 revision = 3 requires-python = ">=3.14" +[[package]] +name = "adata" +version = "2.9.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "beautifulsoup4" }, + { name = "pandas" }, + { name = "py-mini-racer" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0e/da/1eb2f05b14e4d41edcc017b9d6b428f30712d0d046f1b85cd54201b423a5/adata-2.9.5.tar.gz", hash = "sha256:b398fd885ee31baca41b8a141c586d3430ef0fec633f6088a830429437210cf6", size = 188823, upload-time = "2025-12-26T11:09:29.759Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1d/9f/51a65fb438febc0ab38f493a837c5aeb9135dfee2e2c1224920038bbc686/adata-2.9.5-py3-none-any.whl", hash = "sha256:f9dc5d276f8771cf5a5f11fb81c6d97a00d188e20cfcef67022f210c8b23cbf1", size = 229158, upload-time = "2025-12-26T11:09:23.007Z" }, +] + [[package]] name = "akracer" version = "0.0.14" @@ -165,6 +180,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b3/b6/cf57538b968c5caa60ee626ec8be1c31e420067d2a4cf710d81605356f8c/backtesting-0.6.5-py3-none-any.whl", hash = "sha256:8ac2fa500c8fd83dc783b72957b600653a72687986fe3ca86d6ef6c8b8d74363", size = 192105, upload-time = "2025-07-30T05:57:03.322Z" }, ] +[[package]] +name = "baostock" +version = "0.8.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pandas" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ee/d5/0fb2c61f392f89b1655490acb17a02861f1f1c38e973c9fc6aa049e54401/baostock-0.8.9.tar.gz", hash = "sha256:8169cdbed14fa442ace63c59549bef3f92b0c3dd1df9e5d9069f7bd04a76b0da", size = 21876, upload-time = "2024-05-31T02:56:54.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b2/37/bbabac2d33723d71bd8dbd5e819d9cbe5dc1e031b7dd12ed7de8fa040816/baostock-0.8.9-py3-none-any.whl", hash = "sha256:7a51fb30cd6b4325f5517198e350dc2fffaaab2923cd132b9f747b8b73ae7303", size = 45923, upload-time = "2024-05-31T02:56:53.161Z" }, +] + [[package]] name = "beautifulsoup4" version = "4.14.3" @@ -1013,8 +1040,10 @@ name = "leopard-analysis" version = "0.1.0" source = { virtual = "." } dependencies = [ + { name = "adata" }, { name = "akshare" }, { name = "backtesting" }, + { name = "baostock" }, { name = "duckdb" }, { name = "jupyter" }, { name = "jupyter-bokeh" }, @@ -1033,8 +1062,10 @@ dependencies = [ [package.metadata] requires-dist = [ + { name = "adata", specifier = ">=2.9.5" }, { name = "akshare", specifier = ">=1.18.20" }, { name = "backtesting", specifier = "~=0.6.5" }, + { name = "baostock", specifier = ">=0.8.9" }, { name = "duckdb", specifier = ">=1.4.4" }, { name = "jupyter", specifier = "~=1.1.1" }, { name = "jupyter-bokeh", specifier = ">=4.0.5" }, @@ -1562,7 +1593,9 @@ version = "0.6.0" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/50/97/a578b918b2e5923dd754cb60bb8b8aeffc85255ffb92566e3c65b148ff72/py_mini_racer-0.6.0.tar.gz", hash = "sha256:f71e36b643d947ba698c57cd9bd2232c83ca997b0802fc2f7f79582377040c11", size = 5994836, upload-time = "2021-04-22T07:58:35.993Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/13/13/058240c7fd1fbf29a24bda048d93346c2a56275736b76b56afe64050a161/py_mini_racer-0.6.0-py2.py3-none-macosx_10_10_x86_64.whl", hash = "sha256:346e73bb89a2024888244d487834be24a121089ceb0641dd0200cb96c4e24b57", size = 5280865, upload-time = "2021-04-22T07:58:29.118Z" }, { url = "https://files.pythonhosted.org/packages/29/a9/8ce0ca222ef04d602924a1e099be93f5435ca6f3294182a30574d4159ca2/py_mini_racer-0.6.0-py2.py3-none-manylinux1_x86_64.whl", hash = "sha256:42896c24968481dd953eeeb11de331f6870917811961c9b26ba09071e07180e2", size = 5416149, upload-time = "2021-04-22T07:58:25.615Z" }, + { url = "https://files.pythonhosted.org/packages/5d/71/76ac5d593e14b148a4847b608c5ad9a2c7c4827c796c33b396d0437fa113/py_mini_racer-0.6.0-py2.py3-none-win_amd64.whl", hash = "sha256:97cab31bbf63ce462ba4cd6e978c572c916d8b15586156c7c5e0b2e42c10baab", size = 4797809, upload-time = "2021-04-22T07:58:32.286Z" }, ] [[package]]