This project automates the workflow of reading and filtering Japanese CSV data, processing it in Excel via VBA macros, and post-processing results using OpenAI's API.
- CSV Preparation:
main.pyreads and filters CSV files from thepublicdirectory, saving filtered results torunMacro/target_macro_input.json. - Excel Automation:
vba_simulation.pyloads the JSON, writes it torunMacro.xlsm, runs the macro, and saves results torunMacro/target_macro_output.json. - AI Processing:
ai_connect.pysends macro output JSON to OpenAI for further processing (e.g., language conversion).
- Place your CSV files in the
publicdirectory. - Run
main.pyto filter and export data:python main.py
- Run
vba_simulation.pyto automate Excel and run the macro:python vba_simulation.py
- Run
ai_connect.pyto process the macro output with OpenAI:python ai_connect.py
- Python 3.10+
- Install dependencies:
pip install -r requirements.txt - Excel with macros enabled
- OpenAI API key in
.envfile
main.py: CLI for CSV filtering and exportinit_csv.py: CSV reading and filtering utilitiesvba_simulation.py: Excel automation and macro executionai_connect.py: OpenAI API integration for post-processing
- Ensure macros are enabled and Excel security settings allow automation.
- Place your OpenAI API key in a
.envfile asOPENAI_API_KEY=your_key_here. - If you encounter encoding errors, check your CSV file format.
MIT