This project leverages Python to automate the processing of Excel data. The script reads data from a specified Excel file and automatically appends new information while avoiding duplicates. Two storage options are provided:
- Excel File: Save the tick data into another Excel file.
- Database Storage: Save the tick data into a database (e.g., MySQL, MariaDB).
Using this technology, stock tick data is recorded in real time. The script is triggered when the Excel file is saved. In conjunction with a VBA macro embedded in the Excel file—which performs periodic saves (for example, every 5 seconds)—the system continuously captures and updates the tick data.
Prerequisites:
- Microsoft Excel installed.
- Python installed (along with libraries such as pandas and openpyxl).
- Access to Rakuten Securities’ Market Speed 2.
Usage Overview:
-
File Path Configuration:
Adjust file paths within the script (such as the variables for the input Excel file and the JSON output file) to match your environment. -
Environment Setup:
Ensure that all required Python libraries are installed (e.g., by runningpip install openpyxl pandas). -
Script Execution:
Once configured, execute the script from your terminal or command prompt. The script will automatically read, process, and save data from the Excel file. -
Automated Trigger:
The script is designed to run when the Excel file is saved. A VBA macro embedded within the Excel file performs periodic saves (e.g., every 5 seconds) to trigger data capture continuously.
For more detailed instructions and guidance, please refer to the accompanying blog post and YouTube video (both originally published on April 4, 2024).