This is a Flask-based fund monitoring system for monitoring fund net asset value and share changes.
- Automatically fetch fund data
- Display fund net asset value changes
- Display fund share changes
- Provide API interface
- Scheduled task execution
- Web interface display
Before using this system, you need to configure the following environment variables:
SECRET_KEY- Secret key for Flask applicationFUND_API_URL- Fund data API URLDEFAULT_CUSTNOS- Default customer number list, comma-separated, e.g.:custno1,custno2
docker-compose up --build-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
# Copy sample configuration file cp .env.sample .env # Edit .env file and fill in actual values # On Windows, you can use an editor to open it, on Linux/Mac you can use: # nano .env or vim .env
-
Run the application:
python run.py
GET /api/funds/today-changes?custno=<custno>- Get today's fund changesGET /api/funds/nav-changes?custno=<custno>- Get fund net asset value changesGET /api/funds/volume-changes?custno=<custno>- Get fund share changesGET /api/funds/by-date?date=<date>- Get fund data for a specific dateGET /api/funds/compare?datef=<date_from>&datet=<date_to>- Get fund data comparison for a date rangePOST /api/funds/refresh- Manually trigger data fetching
The system uses APScheduler to execute scheduled tasks, with the default configuration to execute the data fetching task daily at 18:25.
For security reasons, all sensitive information (such as API URL, customer numbers, etc.) should be configured through environment variables, and should not be hard-coded in the code.
MIT