How raziele/creditcardanalysis works
Project Type and Purpose
• This project is a Google Apps Script add-on that integrates with Google Sheets. Its primary purpose is to parse files exported from Israeli credit card companies, organize the data into a table, and provide a basic dashboard (using Google Data Studio).
• The README walks through installation, configuration (choosing a folder in Google Drive and copying a template sheet), and usage (triggers via custom menus in the spreadsheet). This indicates a tight integration with Google Drive and Google Sheets.
Analyzing the File Structure
• Top-level directories and files:
• The “src” folder holds key JavaScript files:
• CreditCardParsers.js (handles parsing of credit card export files)
• HelperFunctions.js (contains utility functions)
• Main.js (likely coordinates the overall workflow)
• UserInterface.js (manages the UI aspects, such as creating the custom menu in the spreadsheet)
• The “appsscript.json” file in “src” defines the Google Apps Script project’s configuration (e.g., manifest settings, libraries, etc.).
• Other important files:
• .github and its workflows indicate automated deployment scripts (potentially using clasp) for version control and deployment.
• Files like .clasp.json and .claspignore indicate that this project is managed and deployed using the clasp tool which is common with Google Apps Script projects.
• The “imgs” directory contains visual assets used in the README for guiding the user through installation and usage.
Key Components
a. Frontend / UI Component:
• The UserInterface.js and the custom menu integrated into the spreadsheet.
• This component is responsible for letting users kick off operations (like “Detect analysis file” or “Configure report folder”) directly via the Google Sheets UI.
b. Backend / Processing Logic:
• Main.js serves as the coordinator that calls functions from CreditCardParsers.js and HelperFunctions.js.
• CreditCardParsers.js parses the exported credit card files, and HelperFunctions.js offers supporting utilities.
c. Google Services Integration:
• The Google Drive integration (for reading files from a designated folder).
• Google Sheets integration (for updating the “DB” and “Categories” sheets).
• The configuration file (appsscript.json) that binds these together with the proper permissions.
d. Deployment & Source Control:
• The .github workflows and clasp configuration show that deployment automation and version control are part of the process.
Relationships and Data Flows
• User Interaction: Through the custom menu, users trigger functions that invoke the back-end processing.
• File Intake: The system accesses a specific Google Drive folder (as specified by the folder ID) to retrieve exported credit card report files.
• Data Processing: Using functions in CreditCardParsers.js, the raw credit card data is parsed and processed.
• Data Updating: Processed data is then written into the Google Sheet (updating the “DB” sheet and populating or modifying the “Categories” sheet).
• Reporting/Dashboard: The final structured data feeds into a dashboard (as seen in the Google Data Studio screenshot) for visualization.
Architectural Patterns and Design Principles
• Modular structure: The splitting of concerns across separate scripts (UI, main logic, parsing utilities) promotes separation of concerns.
• Event-driven interactions: User actions in the spreadsheet trigger the processing functions.
• Integration with external Google services (Drive and Sheets) with proper configuration via the manifest (appsscript.json).