How bennythadikaran/eod2 works
Main Components
• Data Ingestion & Update Engine: This is primarily handled by the script in dget.py, which periodically fetches NSE stock data, performs historical adjustments, and updates CSV files.
• Data Storage Layer: The CSV files stored in directories like src/eod2_data (including the “daily” subfolder mentioned in the README) and src/data (with sectors.csv) represent the persistent storage of processed stock and index information.
• Core Definitions & Utilities: The src/defs directory (with Config.py, Plotter.py, Plugin.py, defs.py, diagnostic.py, and utils.py) encapsulates the core configurations, utility functions, plotting functionality, and plugin mechanisms. These modules form the backbone of the project logic.
• Plugin System: Under src/plugin (e.g., rsi.py), specialized analysis components extend capabilities (like technical indicators). This demonstrates a level of modular design, where additional analysis can be integrated via plugins.
• Visualization/Plotting: Managed by plot.py (and supported by Plotter.py in src/defs), this component allows analysis through charts. It includes interactive tools (support, resistance, trend, and trading lines) as showcased in the README images.
• Testing & Validation: The tests directory with a variety of test scripts ensures that the core functionalities (data loading, module handling, utility functions) have automated checks in place.
• Setup & Configuration: Files like setup_data.py and requirements.txt are used to initialize data and manage dependencies.
Relationships and Data Flow
• User Interaction / Cron Jobs: Initiates the execution of the main scripts (dget.py for data updates and plot.py for visualization).
• Data Retrieval: dget.py interacts with NSE endpoints (external service) to download daily data.
• Data Adjustment and Storage: The fetched data is processed using logic defined in the defs modules and then stored as CSV files (organized under src/eod2_data and src/data).
• Configuration & Plugin Integration: The core configuration module (Config.py) controls parameters, while the Plugin.py and additional modules under src/plugin (like rsi.py) provide additional technical analysis capabilities.
• Visualization: When plot.py is executed, it references the processed CSV data and uses Plotter.py to generate visual charts, optionally leveraging plugins for technical indicators.
Architectural Patterns and Principles
• Modularity and Separation of Concerns: Distinct directories and modules separate data ingestion, processing, configuration, plug-in management, and visualization.
• Extensibility: The plugin structure allows easy addition of more analysis tools without modifying the core system.
• Data Flow Independence: Data is stored persistently in CSVs, which provides a clear demarcation between data ingestion and visualization layers.
• Testing and Robustness: The testing folder ensures that each layer can be validated independently, promoting reliability.