Skip to content
This repository was archived by the owner on Feb 7, 2022. It is now read-only.

Commit b418b7c

Browse files
committed
Minor improvements and dependency updates
1. Upgrade HtmlAgilityPack from V1.11.32 to V1.11.34. 2. Upgrade Syncfusion WPF UI from V19.1.0.55 to V19.1.0.69. 3. Upgrade Python from 3.8.8 to 3.8.10. 4. Upgrade Pandas from 1.2.3 to 1.2.4. 5. Improve the validation and update step of the process of getting a stock list. 6. Update the stock list. 7. Update README.
1 parent dfdbcf4 commit b418b7c

File tree

9 files changed

+77
-57
lines changed

9 files changed

+77
-57
lines changed

ShSzStockHelper/App.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
22
* @Description: the back-end code of initialising the app
3-
* @Version: 1.1.2.20210415
3+
* @Version: 1.1.3.20210620
44
* @Author: Arvin Zhao
55
* @Date: 2020-07-08 10:17:48
66
* @Last Editors: Arvin Zhao
7-
* @LastEditTime: 2021-04-15 00:02:55
7+
* @LastEditTime: 2021-06-20 00:02:55
88
*/
99

1010
using Bluegrams.Application;
@@ -45,7 +45,7 @@ public App()
4545
#else
4646
_productId = Assembly.GetExecutingAssembly().GetName().Name;
4747
#endif
48-
SyncfusionLicenseProvider.RegisterLicense("NDI2NzY5QDMxMzkyZTMxMmUzMFY3Z3hHcE9WR1JzVWRoUVZldVVOYXNkL3JJTzBmQXV2ajh5b295bXRtT1k9"); // Register a Syncfusion (V19.1.0.55) license.
48+
SyncfusionLicenseProvider.RegisterLicense("NDYxMzY4QDMxMzkyZTMxMmUzMFBkSlRUS1dxeGRBZFlYcTlRaG5VM21zdERZZXp0NEJtMFhkTUNRclYwbHM9"); // Register a Syncfusion (V19.1.0.69) license.
4949
Thread.CurrentThread.CurrentUICulture = new CultureInfo(ShSzStockHelper.Properties.Settings.Default.CultureInfo); // It is necessary to specify the culture info here and in the name of the resource file "Syncfusion.Tools.Wpf" to avoid the issue that some text of the tab control is not displayed in simplified Chinese.
5050
LoadProductInfo();
5151
ConfigSettingsProvider();

ShSzStockHelper/README-zhCN.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111

1212
## 注意
1313

14-
1. 截至2021年4月10日,使用Visual Studio 2019(版本:16.9.4)和Windows呈现基础(WPF,.NET Core 3.1)开发表现良好。此外,我要特别感谢Syncfusion提供的[强大的WPF的UI组件库](https://www.syncfusion.com/wpf-ui-controls),这节省了许多开发时间。
14+
1. 截至2021年6月20日,使用Visual Studio 2019(版本:16.10.2)和Windows呈现基础(WPF,.NET Core 3.1)开发表现良好。此外,我要特别感谢Syncfusion提供的[强大的WPF的UI组件库](https://www.syncfusion.com/wpf-ui-controls),这节省了许多开发时间。
1515
2. 应用用到的图标资源主要来自[Material Design图标库](https://material.io/resources/icons/?style=baseline)[Flaticon](https://www.flaticon.com/)
1616
3. 应用用到的主要的NuGet包参见下面的表格。
1717

1818
| 名称 | 版本 |
1919
| :-- | :--: |
20-
| [HtmlAgilityPack](https://html-agility-pack.net/) | 1.11.32 |
20+
| [HtmlAgilityPack](https://html-agility-pack.net/) | 1.11.34 |
2121
| [Newtonsoft.Json](https://www.newtonsoft.com/json) | 13.0.1 |
2222
| [PortableSettingsProvider](https://github.com/Bluegrams/SettingsProviders) | 0.2.4 |
23-
| Syncfusion.DataGridExcelExport.Wpf | 19.1.0.55 |
24-
| Syncfusion.SfBusyIndicator.WPF | 19.1.0.55 |
25-
| Syncfusion.SfGrid.WPF | 19.1.0.55 |
26-
| Syncfusion.SfInput.WPF | 19.1.0.55 |
27-
| Syncfusion.SfTreeNavigator.WPF | 19.1.0.55 |
28-
| Syncfusion.Themes.MaterialDark.WPF | 19.1.0.55 |
29-
| Syncfusion.Themes.MaterialLight.WPF | 19.1.0.55 |
30-
| Syncfusion.Tools.WPF | 19.1.0.55 |
23+
| Syncfusion.DataGridExcelExport.Wpf | 19.1.0.69 |
24+
| Syncfusion.SfBusyIndicator.WPF | 19.1.0.69 |
25+
| Syncfusion.SfGrid.WPF | 19.1.0.69 |
26+
| Syncfusion.SfInput.WPF | 19.1.0.69 |
27+
| Syncfusion.SfTreeNavigator.WPF | 19.1.0.69 |
28+
| Syncfusion.Themes.MaterialDark.WPF | 19.1.0.69 |
29+
| Syncfusion.Themes.MaterialLight.WPF | 19.1.0.69 |
30+
| Syncfusion.Tools.WPF | 19.1.0.69 |
3131

3232
## 用户界面示例
3333

ShSzStockHelper/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ This is the Visual Studio solution folder of the application. It contains code a
1111

1212
## ATTENTION
1313

14-
1. By 10 April 2021, everything looks good with Visual Studio 2019 (Version: 16.9.4) + Windows Presentation Foundation (WPF) with .NET Core 3.1. Additionally, I would like to thankfully acknowledge Syncfusion for [its powerful WPF UI controls and libraries](https://www.syncfusion.com/wpf-ui-controls), which save much development time.
14+
1. By 20 June 2021, everything looks good with Visual Studio 2019 (Version: 16.10.2) + Windows Presentation Foundation (WPF) with .NET Core 3.1. Additionally, I would like to thankfully acknowledge Syncfusion for [its powerful WPF UI controls and libraries](https://www.syncfusion.com/wpf-ui-controls), which save much development time.
1515
2. Most of icon images used by the application are from [Material Design Icons](https://material.io/resources/icons/?style=baseline) and [Flaticon](https://www.flaticon.com/).
1616
3. The primary NuGet packages used in the application are listed in the following table.
1717

1818
| Name | Version |
1919
| :-- | :--: |
20-
| [HtmlAgilityPack](https://html-agility-pack.net/) | 1.11.32 |
20+
| [HtmlAgilityPack](https://html-agility-pack.net/) | 1.11.34 |
2121
| [Newtonsoft.Json](https://www.newtonsoft.com/json) | 13.0.1 |
2222
| [PortableSettingsProvider](https://github.com/Bluegrams/SettingsProviders) | 0.2.4 |
23-
| Syncfusion.DataGridExcelExport.Wpf | 19.1.0.55 |
24-
| Syncfusion.SfBusyIndicator.WPF | 19.1.0.55 |
25-
| Syncfusion.SfGrid.WPF | 19.1.0.55 |
26-
| Syncfusion.SfInput.WPF | 19.1.0.55 |
27-
| Syncfusion.SfTreeNavigator.WPF | 19.1.0.55 |
28-
| Syncfusion.Themes.MaterialDark.WPF | 19.1.0.55 |
29-
| Syncfusion.Themes.MaterialLight.WPF | 19.1.0.55 |
30-
| Syncfusion.Tools.WPF | 19.1.0.55 |
23+
| Syncfusion.DataGridExcelExport.Wpf | 19.1.0.69 |
24+
| Syncfusion.SfBusyIndicator.WPF | 19.1.0.69 |
25+
| Syncfusion.SfGrid.WPF | 19.1.0.69 |
26+
| Syncfusion.SfInput.WPF | 19.1.0.69 |
27+
| Syncfusion.SfTreeNavigator.WPF | 19.1.0.69 |
28+
| Syncfusion.Themes.MaterialDark.WPF | 19.1.0.69 |
29+
| Syncfusion.Themes.MaterialLight.WPF | 19.1.0.69 |
30+
| Syncfusion.Tools.WPF | 19.1.0.69 |
3131

3232
## Partial UI (For Reference Only)
3333

ShSzStockHelper/Resources/StockSymbolNameData.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

ShSzStockHelper/ShSzStockHelper.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
</PropertyGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="HtmlAgilityPack" Version="1.11.32" />
28+
<PackageReference Include="HtmlAgilityPack" Version="1.11.34" />
2929
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
3030
<PackageReference Include="PortableSettingsProvider" Version="0.2.4" />
31-
<PackageReference Include="Syncfusion.DataGridExcelExport.Wpf" Version="19.1.0.55" />
32-
<PackageReference Include="Syncfusion.SfBusyIndicator.WPF" Version="19.1.0.55" />
33-
<PackageReference Include="Syncfusion.SfGrid.WPF" Version="19.1.0.55" />
34-
<PackageReference Include="Syncfusion.SfInput.WPF" Version="19.1.0.55" />
35-
<PackageReference Include="Syncfusion.SfTreeNavigator.WPF" Version="19.1.0.55" />
36-
<PackageReference Include="Syncfusion.Themes.MaterialDark.WPF" Version="19.1.0.55" />
37-
<PackageReference Include="Syncfusion.Themes.MaterialLight.WPF" Version="19.1.0.55" />
38-
<PackageReference Include="Syncfusion.Tools.WPF" Version="19.1.0.55" />
31+
<PackageReference Include="Syncfusion.DataGridExcelExport.Wpf" Version="19.1.0.69" />
32+
<PackageReference Include="Syncfusion.SfBusyIndicator.WPF" Version="19.1.0.69" />
33+
<PackageReference Include="Syncfusion.SfGrid.WPF" Version="19.1.0.69" />
34+
<PackageReference Include="Syncfusion.SfInput.WPF" Version="19.1.0.69" />
35+
<PackageReference Include="Syncfusion.SfTreeNavigator.WPF" Version="19.1.0.69" />
36+
<PackageReference Include="Syncfusion.Themes.MaterialDark.WPF" Version="19.1.0.69" />
37+
<PackageReference Include="Syncfusion.Themes.MaterialLight.WPF" Version="19.1.0.69" />
38+
<PackageReference Include="Syncfusion.Tools.WPF" Version="19.1.0.69" />
3939
</ItemGroup>
4040

4141
<ItemGroup>

ShSzStockSymbolNameData/README-zhCN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
## 注意
88

9-
1. IPYNB格式的文件可以使用Visual Studio Code(需版本支持)打开并编辑。截至2021年4月13日,使用此代码编辑器(版本:1.55.2)开发表现良好。你也可以使用Anaconda中的Jupyter Notebook。此外,我想感谢[TuShare Pro](https://tushare.pro/)提供的宝贵数据。开发用到的主要的包参见下面的表格。
9+
1. IPYNB格式的文件可以使用Visual Studio Code(需版本支持)打开并编辑。截至2021年6月20日,使用此代码编辑器(版本:1.57.1)开发表现良好。你也可以使用Anaconda中的Jupyter Notebook。此外,我想感谢[TuShare Pro](https://tushare.pro/)提供的宝贵数据。开发用到的主要的包参见下面的表格。
1010

1111
| 名称 | 版本 |
1212
| :--: | :--: |
13-
| python | 3.8.8 |
13+
| python | 3.8.10 |
1414
| tushare | 1.2.62 |
15-
| pandas | 1.2.3 |
15+
| pandas | 1.2.4 |

ShSzStockSymbolNameData/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ This folder contains a Jupyter Notebook file with Python code to retrieve and st
66

77
## ATTENTION
88

9-
1. The IPYNB file can be opened and edited in Visual Studio Code (if supported). By 13 April 2021, everything looks good with the code editor (Version: 1.55.2). As an option, you can also use Jupyter Notebook in Anaconda. In addition, I would like to thank [TuShare Pro](https://tushare.pro/) for its valuabale data. The primary packages used in the development are listed in the following table.
9+
1. The IPYNB file can be opened and edited in Visual Studio Code (if supported). By 20 June 2021, everything looks good with the code editor (Version: 1.57.1). As an option, you can also use Jupyter Notebook in Anaconda. In addition, I would like to thank [TuShare Pro](https://tushare.pro/) for its valuabale data. The primary packages used in the development are listed in the following table.
1010

1111
| Name | Version |
1212
| :--: | :--: |
13-
| python | 3.8.8 |
13+
| python | 3.8.10 |
1414
| tushare | 1.2.62 |
15-
| pandas | 1.2.3 |
15+
| pandas | 1.2.4 |

ShSzStockSymbolNameData/StockSymbolNameData.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

ShSzStockSymbolNameData/main.ipynb

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
"name": "python",
1111
"nbconvert_exporter": "python",
1212
"pygments_lexer": "ipython3",
13-
"version": "3.8.8-final"
13+
"version": "3.8.8"
1414
},
1515
"orig_nbformat": 2,
1616
"kernelspec": {
17-
"name": "python388jvsc74a57bd083ad9dc287f1bd68e1373a062e5fec25449c786b53be0804b995b765c2d61fc9",
18-
"display_name": "Python 3.8.8 64-bit (conda)"
17+
"name": "python3",
18+
"display_name": "Python 3.8.8 64-bit ('base': conda)"
19+
},
20+
"interpreter": {
21+
"hash": "83ad9dc287f1bd68e1373a062e5fec25449c786b53be0804b995b765c2d61fc9"
1922
}
2023
},
2124
"nbformat": 4,
@@ -25,15 +28,15 @@
2528
"cell_type": "markdown",
2629
"metadata": {},
2730
"source": [
28-
"Description: the Jupyter Notebook file containing the code for getting and briefly validating data of stock symbols and corresponding names\n",
31+
"Description: the Jupyter Notebook file containing the code for getting, validating, and updating data of stock symbols and corresponding names\n",
2932
"\n",
30-
"Version: 1.0.2.20210121\n",
33+
"Version: 1.1.0.20210620\n",
3134
"\n",
3235
"Author: Arvin Zhao\n",
3336
"\n",
3437
"Last editors: Arvin Zhao\n",
3538
"\n",
36-
"Last time when data was retrieved: 2021-01-17 12:36:00"
39+
"Last time when data was retrieved: 2021-06-20 12:36:00"
3740
]
3841
},
3942
{
@@ -54,15 +57,15 @@
5457
"output_type": "stream",
5558
"name": "stdout",
5659
"text": [
57-
"The number of stocks: 4224 \nThe first 10 records:\n ts_code name\n0 000001.SZ 平安银行\n1 000002.SZ 万科A\n2 000004.SZ 国华网安\n3 000005.SZ 世纪星源\n4 000006.SZ 深振业A\n5 000007.SZ 全新好\n6 000008.SZ 神州高铁\n7 000009.SZ 中国宝安\n8 000010.SZ 美丽生态\n9 000011.SZ 深物业A\n"
60+
"The number of stocks: 4347 \nThe first 10 records:\n ts_code name\n0 000001.SZ 平安银行\n1 000002.SZ 万科A\n2 000004.SZ 国华网安\n3 000005.SZ ST星源\n4 000006.SZ 深振业A\n5 000007.SZ *ST全新\n6 000008.SZ 神州高铁\n7 000009.SZ 中国宝安\n8 000010.SZ 美丽生态\n9 000011.SZ 深物业A\n"
5861
]
5962
}
6063
],
6164
"source": [
6265
"import tushare as ts\n",
6366
"\n",
64-
"ts_pro = ts.pro_api('f5bf618f99204f6f3cc805606ae262f6f514e526c7ad950ce2e4214d') # Initialise Tushare Pro API with my token.\n",
65-
"data = ts_pro.stock_basic(exchange = '', list_status = 'L', fields = 'ts_code, name') # Use the specified API to get a DataFrame object containing the specified data.\n",
67+
"ts_pro = ts.pro_api('f5bf618f99204f6f3cc805606ae262f6f514e526c7ad950ce2e4214d') # Initialise Tushare Pro API with my token.\n",
68+
"data = ts_pro.stock_basic(exchange = '', list_status = 'L', fields = 'ts_code, name') # Use the specified API to get a DataFrame object containing the specified data.\n",
6669
"\n",
6770
"print('The number of stocks:', data.shape[0], '\\nThe first 10 records:\\n', data.head(n = 10))"
6871
]
@@ -96,14 +99,14 @@
9699
"cell_type": "markdown",
97100
"metadata": {},
98101
"source": [
99-
"<h2>Brief Validation</h2>\n",
102+
"<h2>Brief Validation & Update</h2>\n",
100103
"\n",
101104
"\"mbcs\" represents ASCII encoding. **Please do use Notepad instead of other editors like VS Code to modify the data file to ensure the encoding is not changed to UTF-8 or the others.**"
102105
]
103106
},
104107
{
105108
"cell_type": "code",
106-
"execution_count": 5,
109+
"execution_count": 4,
107110
"metadata": {
108111
"tags": []
109112
},
@@ -112,19 +115,36 @@
112115
"output_type": "stream",
113116
"name": "stdout",
114117
"text": [
115-
"Same data? False\n"
118+
"Same data? False\nSame data now? True\n"
116119
]
117120
}
118121
],
119122
"source": [
120-
"import json\n",
123+
"import json, shutil\n",
124+
"\n",
125+
"target_dir = os.path.join(os.path.dirname(os.getcwd()), 'ShSzStockHelper', 'Resources') # Locate the app development directory containing a data file pending comparison/update.\n",
126+
"path_previous_data = os.path.join(target_dir, data_filename) # Locate the data file in the specified app development directory.\n",
121127
"\n",
122-
"list_new_data = json.load(open(data_filename, encoding = 'mbcs'))\n",
123-
"list_previous_data = json.load(open(os.path.join(os.path.dirname(os.getcwd()), 'ShSzStockHelper', 'Resources', data_filename), encoding = 'mbcs'))\n",
128+
"if os.path.exists(data_filename):\n",
129+
" if os.path.exists(target_dir):\n",
130+
" is_same = False\n",
124131
"\n",
125-
"symbol_key_name = 'ts_code'\n",
132+
" if os.path.exists(path_previous_data):\n",
133+
" list_new_data = json.load(open(data_filename, encoding = 'mbcs'))\n",
134+
" list_previous_data = json.load(open(path_previous_data, encoding = 'mbcs'))\n",
135+
" symbol_key_name = 'ts_code'\n",
136+
" is_same = sorted(list_new_data, key = lambda x : x[symbol_key_name]) == sorted(list_previous_data, key = lambda x : x[symbol_key_name])\n",
137+
" print('Same data?', is_same)\n",
126138
"\n",
127-
"print('Same data?', sorted(list_new_data, key = lambda x : x[symbol_key_name]) == sorted(list_previous_data, key = lambda x : x[symbol_key_name]))"
139+
" if not is_same:\n",
140+
" shutil.copy2(data_filename, target_dir)\n",
141+
" list_previous_data = json.load(open(path_previous_data, encoding = 'mbcs'))\n",
142+
" is_same = sorted(list_new_data, key = lambda x : x[symbol_key_name]) == sorted(list_previous_data, key = lambda x : x[symbol_key_name])\n",
143+
" print('Same data now?', is_same)\n",
144+
" else:\n",
145+
" print('Error! The specified app development directory does not exist.')\n",
146+
"else:\n",
147+
" print('Error! Please first get new data.')"
128148
]
129149
}
130150
]

0 commit comments

Comments
 (0)