{"id":27142397,"url":"https://github.com/evans-prince/command-line-excel","last_synced_at":"2026-05-01T16:36:09.971Z","repository":{"id":286558389,"uuid":"941899207","full_name":"evans-prince/Command-Line-Excel","owner":"evans-prince","description":"A modular, command-line spreadsheet application in C featuring formula evaluation, dependency management with DAG, and efficient recalculation — complete with testing, debugging, and LaTeX-based reporting.","archived":false,"fork":false,"pushed_at":"2025-04-07T06:48:56.000Z","size":279,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-07T07:25:56.628Z","etag":null,"topics":["c","dag","dependency-graph","formula-evaluator","gdb","latex","lldb","makefile","memory-bugs","memory-management","spreadsheet","valgrind","vim","xcode"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evans-prince.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-03T08:39:26.000Z","updated_at":"2025-04-07T07:10:38.000Z","dependencies_parsed_at":"2025-04-07T07:26:01.934Z","dependency_job_id":"779a0031-ea04-4b33-8a6f-aaeba5f5d698","html_url":"https://github.com/evans-prince/Command-Line-Excel","commit_stats":null,"previous_names":["evans-prince/command-line-excel"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evans-prince%2FCommand-Line-Excel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evans-prince%2FCommand-Line-Excel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evans-prince%2FCommand-Line-Excel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evans-prince%2FCommand-Line-Excel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evans-prince","download_url":"https://codeload.github.com/evans-prince/Command-Line-Excel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801181,"owners_count":20998331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","dag","dependency-graph","formula-evaluator","gdb","latex","lldb","makefile","memory-bugs","memory-management","spreadsheet","valgrind","vim","xcode"],"created_at":"2025-04-08T07:46:24.729Z","updated_at":"2026-05-01T16:36:09.898Z","avatar_url":"https://github.com/evans-prince.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Command-Line Excel: Spreadsheet Project\n\n**Author:** Prince\\\n**Start Date:** 01-Feb-2025\n\n---\n\n## 📌 Overview\n\nThis project is a command-line spreadsheet program developed in C, supporting integer-only cell values, formulas, and efficient recalculation using a Directed Acyclic Graph (DAG). It mimics core functionalities of Excel such as cell assignment, formula evaluation, and dependency tracking, all within a terminal interface.\n\n---\n\n## ✨ Features\n\n- 📊 **Spreadsheet Grid**: Supports sizes from 1x1 up to 999x18278 (A1 to ZZZ999).\n- 🔗 **Formula Evaluation**: Supports arithmetic operations and range-based functions (e.g., `SUM(A1:A5)`).\n- 🔄 **Efficient Recalculation**: Uses topological sorting and a calculation chain for updating only necessary cells.\n- ♻️ **Dependency Management**: Tracks dependencies and dependents for each cell using CellRange structs.\n- ⛔ **Error Handling**: Detects circular references, invalid inputs, and handles edge cases like division by zero.\n- 🧪 **Testing Suite**: Modular unit tests for formula parsing, input handling, and recalculation.\n- 🧱 **Modular Design**: Divided into reusable modules for better maintainability and scalability.\n\n---\n\n## 🛠️ Design Structure\n\n### Spreadsheet Core\n\n- `cell** grid`: 2D array for cells.\n- `calculation_chain[]`: Optimized recalculation order.\n- `CommandStatus`: Stores status and execution time of last command.\n\n### Input Handling\n\n- Tokenizes and classifies inputs using enums.\n- Validates syntax for cell assignments, formulas, function calls, and scroll commands.\n\n### Recalculation Engine\n\n- Dirty flag mechanism for tracking updates.\n- Topological sorting to determine update order.\n- Selective recalculation based on dependencies.\n\n### Error Handling\n\n- Invalid syntax detection.\n- Circular reference prevention.\n- Graceful handling of undefined operations (e.g., `A1=10/0`).\n\n---\n\n## 🤩 Directory Structure\n\n```plaintext\n.\n├── include/               # Header files\n│   ├── spreadsheet.h\n│   ├── recalculation.h\n│   ├── input_handler.h\n│   └── ...\n├── src/                   # Source files\n│   ├── spreadsheet.c\n│   ├── recalculation.c\n│   ├── input_handler.c\n│   └── ...\n├── lib/                   # Utility functions\n│   └── utils.c\n├── tests/                 # Unit tests\n│   ├── test_input.c\n│   ├── test_formula.c\n│   └── ...\n├── Makefile               # Build automation\n└── report/                # LaTeX report files\n    └── report.pdf\n```\n\n---\n\n## How to Run 🚀\n\n### Prerequisites\n\nA Linux, macOS, or Windows system with:\n- GCC (GNU Compiler Collection)\n- `make` or `mingw32-make`\n- `pdflatex` for LaTeX report generation (optional)\n\n\n### 🔢 Build \u0026 Run Commands\n\n#### Linux/macOS:\n```bash\n# Clone the repository\ngit clone https://github.com/evans-prince/Command-Line-Excel.git\ncd Command-Line-Excel/Command-Line-Excel\n\n# Build the project\nmake\n\n# Run the program\n./target/release/spreadsheet 999 18278\n```\n\n#### Windows:\n```bash\n# Open Command Prompt (cmd) or Git Bash\n\n# Clone the repository\ngit clone https://github.com/evans-prince/Command-Line-Excel.git\ncd Command-Line-Excel\\Command-Line-Excel\n\n# Build the project\nmingw32-make\n\n# Run the program\n.target/release/spreadsheet.exe 999 18278\n```\n\n### 📉 Optional Commands\n```bash\n# Run provided tests (Linux/macOS)\nmake test\n\n# Run tests on Windows\nmingw32-make test\n\n# Clean build files\nmake clean         # Linux/macOS\nmingw32-make clean # Windows\n```\n\n---\n\n## 🔗 Project Links\n\n- 📁 **GitHub Repository**: [Command-Line Excel](https://github.com/evans-prince/Command-Line-Excel)\n- 📽️ **Demo Video**: [Watch Demo](https://csciitd-my.sharepoint.com/:v:/g/personal/ph1221248_iitd_ac_in/EYGqIFa5qNRIl2LBnGHC8h8BVRATkNtxBRx4TYOI_3kHiQ?e=2s2BGr)\n\n---\n\n## 📣 Contributions\n\nThis project was collaboratively developed by:\n\n- 👨‍💻 Prince\n- 👨‍💻 Aditya\n\n---\n\n## 📞 Contact\n\nIf you'd like to know more or contribute, feel free to open an issue or contact us via GitHub!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevans-prince%2Fcommand-line-excel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevans-prince%2Fcommand-line-excel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevans-prince%2Fcommand-line-excel/lists"}