How deepcodeview/stock_historic_data works
Main components
• Web Server / Application Logic: The Python files (app.py, app1.py, data_to_db_hist.py, data_to_db_live.py) suggest that the project’s backend logic is implemented in Flask (or a similar Python web framework). This is responsible for routing, data processing, and serving the appropriate web pages.
• Databases: There are multiple database files (historic.db, historic_database.db, live_database.db) indicating that the application interacts with at least two databases – one for historic data and another for live data.
• Frontend: The static templates in the “templates” directory (chart.html, chart_live.html, chart_new.html, chart_only_live.html) and the static CSS file illustrate that the frontend is rendered server-side and is geared towards different types of chart visualizations.
• External Data and Workflows: There is a “currency_list” directory and additional support scripts/notebooks (exp.ipynb) which might be used for preprocessing or additional data feeds. Also, note the GitHub workflows for linting (pylint.yml) which indicate quality checks in the development process.
Understand relationships and interactions
• Routing: The app routes include “/” for historic visualization, “/live” for live data and insertion of new records, and “/onlylive” for tick-by-tick data. These routes are defined in the Flask app(s), and each route is responsible for rendering the appropriate webpage and connecting to the corresponding database.
• Data Flow: The backend scripts (data_to_db_hist.py and data_to_db_live.py) likely manage the ingestion of data into their respective SQLite databases. The live data route also visualizes this data in real time.
• Static/Dynamic Content: The static directory and templates are used to serve the visual components, with CSS for styling.
Architectural Patterns and Design Principles
• MVC-like Separation: Though not a strict MVC implementation, there is a separation between the business logic (Python files managing routes and database interactions) and presentation (HTML templates with static styling).
• Modularity: The project separates concerns – one set of scripts handles historic data while another handles live updates.
• Data Persistence: Using SQLite databases for persistence of live and historic data.
Relevant Technologies
• Python as the programming language.
• Flask (or a similar microframework) for the web application logic.
• SQLite for database management.
• HTML/CSS for rendering the visualization on the front end.
• Jupyter Notebook (exp.ipynb) suggests an exploration or analytical component.