Show HN: Convert Google Sheets to Code
3 days ago
- #Excel
- #TypeScript
- #Automation
- Sheet2Code is an open-source tool that converts Excel and Google Sheets formulas into TypeScript or Python code.
- It supports both Excel (.xlsx) and Google Sheets, preserving calculation logic accurately.
- Features include handling complex nested formulas, array operations, and standard Excel/Google Sheets functions.
- The tool includes dependency analysis, circular reference detection, and topological sorting for correct calculation order.
- Supports named ranges, cross-sheet references, and generates clean, readable code with error handling.
- For Google Sheets, it uses the Google Sheets API with OAuth2 or Service Account authentication.
- For Excel, it supports export to Google Sheets or CSV.
- Includes a Chevrotain-based parser to tokenize and parse formulas into an Abstract Syntax Tree (AST).
- Provides CLI commands for setup, conversion, and execution of generated code.
- Supports watch mode for automatic regeneration when the source sheet changes.
- Handles financial modeling, statistical analysis, and inventory management use cases.
- Supports a wide range of functions including SUM, VLOOKUP, IF, INDEX/MATCH, and SUMIF.
- Generated code is executable from the command line with custom inputs and JSON output.
- Built with modern TypeScript following clean architecture principles.
- Offers professional consulting services for complex conversions.