This project is to extract fund data of China
- Setup http server + php + mysql + phpmyadmin. // https://blog.csdn.net/u010427874/article/details/89007187
- Create mysql database & tables by refer to database_tables.sql. The quick way to do that is restore database_tables.sql via phpmyadmin web portal
- create a db user (e.g. funds_user) and grant write/delete/insert/read access to database funds.
- Create conn.py inside folder configs with following content
host='localhost'
dbname='funds'
dbuser='db user you created'
dbpass='db user password you defined' - Create mysql.php inside folder \api\inc\ with following content
$mysql_server_name="localhost";
$mysql_database="funds";
$mysql_username="db user you created";
$mysql_password="db user password you defined";
- apt install python3
- apt install python3-pip
- apt install apache2
- apt install php
- apt install php-mysql
- pip3 install pyExecJs
- pip3 install pymysql
- pip3 install nodejs
- python3 download_fundcode.py // Download entire fund list. Not require to run every day. It is to detect any newly establish fund
- python3 download_funddata.py // Download all fund history (except currency fund).
- python3 update_funddata.py // Analysis and update fund history data into database
- python3 download_fundcode.py > log.txt &
- python3 download_funddata.py > log.txt &
- python3 update_funddata.py > log.txt &