{"id":32289476,"url":"https://github.com/tegarnugroho/table_parser","last_synced_at":"2026-07-11T06:32:03.348Z","repository":{"id":313453519,"uuid":"1051453129","full_name":"tegarnugroho/table_parser","owner":"tegarnugroho","description":"Table Parser is an extended and improved version of the excellent spreadsheet_decoder package. This library provides enhanced functionality for parsing, manipulating, and updating table documents in various formats including CSV, ODS, and XLSX.","archived":false,"fork":false,"pushed_at":"2025-09-06T05:26:01.000Z","size":182,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-06T18:27:01.308Z","etag":null,"topics":["csv","dart","excel","flutter","ods","parser","table"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/table_parser","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tegarnugroho.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-06T03:06:48.000Z","updated_at":"2026-02-09T13:21:10.000Z","dependencies_parsed_at":"2025-09-06T07:15:01.891Z","dependency_job_id":"5f4af99f-96c1-46de-bd54-d902ccfc70f2","html_url":"https://github.com/tegarnugroho/table_parser","commit_stats":null,"previous_names":["tegarnugroho/table_parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tegarnugroho/table_parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegarnugroho%2Ftable_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegarnugroho%2Ftable_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegarnugroho%2Ftable_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegarnugroho%2Ftable_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tegarnugroho","download_url":"https://codeload.github.com/tegarnugroho/table_parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegarnugroho%2Ftable_parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35353668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csv","dart","excel","flutter","ods","parser","table"],"created_at":"2025-10-23T02:41:17.183Z","updated_at":"2026-07-11T06:32:03.342Z","avatar_url":"https://github.com/tegarnugroho.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Table Parser\n\n[![Pub version](https://img.shields.io/pub/v/table_parser.svg)](https://pub.dartlang.org/packages/table_parser)\n\nTable Parser is an extended and improved version of the excellent [spreadsheet_decoder](https://pub.dev/packages/spreadsheet_decoder) package. This library provides enhanced functionality for parsing, manipulating, and updating table documents in various formats including CSV, ODS, and XLSX.\n\n## Acknowledgments\n\nThis package is built upon the foundation of the [spreadsheet_decoder](https://pub.dev/packages/spreadsheet_decoder) package created by **Sébastien Stehly** ([sestegra](https://github.com/sestegra)). We extend our sincere gratitude for their excellent work and for making it available under the MIT License, which allows for modification and redistribution.\n\n**Original Package**: [spreadsheet_decoder](https://pub.dev/packages/spreadsheet_decoder)  \n**Original Author**: Sébastien Stehly  \n**License**: MIT License\n\n## Key Improvements\n\nThis package extends the original spreadsheet_decoder with:\n\n- **Enhanced CSV Support**: Comprehensive CSV parsing with custom separators, quoted fields, and escape sequences\n- **Better Error Handling**: Improved validation and error reporting\n- **Performance Optimizations**: Better handling of large files and memory usage\n- **Extended API**: Additional methods for table manipulation and data export\n- **Comprehensive Documentation**: More examples and detailed usage instructions\n- **Modern Dart Support**: Updated for Dart 3.0+ with null safety\n\n## Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  table_parser: ^1.0.0\n```\n\nThen run:\n\n```bash\ndart pub get\n```\n\n## Usage\n\n### Quick Start\n\n```dart\nimport 'package:table_parser/table_parser.dart';\nimport 'dart:io';\n\nvoid main() {\n  // Parse CSV\n  var csvContent = '''Name,Age,City\nJohn,30,New York\nJane,25,Los Angeles''';\n  \n  var decoder = TableParser.decodeCsv(csvContent);\n  var table = decoder.tables['Sheet1']!;\n  print(table.rows); // [[Name, Age, City], [John, 30, New York], [Jane, 25, Los Angeles]]\n  \n  // Parse Excel/ODS from file\n  var bytes = File('data.xlsx').readAsBytesSync();\n  var spreadsheet = TableParser.decodeBytes(bytes);\n  var sheet = spreadsheet.tables['Sheet1']!;\n  print('${sheet.maxRows} rows, ${sheet.maxCols} columns');\n}\n```\n\n### CSV Files\n\n#### Basic CSV Parsing\n\n```dart\nimport 'package:table_parser/table_parser.dart';\n\nvoid main() {\n  var csvContent = '''Product,Price,InStock\nLaptop,999.99,true\nMouse,29.99,false''';\n  \n  var decoder = TableParser.decodeCsv(csvContent);\n  var table = decoder.tables['Sheet1']!;\n  \n  // Access data\n  for (var row in table.rows) {\n    print(row);\n  }\n}\n```\n\n#### CSV with Custom Options\n\n```dart\nvar decoder = TableParser.decodeCsv(\n  csvContent,\n  separator: ';',              // Custom separator (default: ',')\n  textDelimiter: '\"',          // Text delimiter for quoted fields (default: null)\n  shouldParseNumbers: true,    // Parse numbers automatically (default: true)\n  eol: '\\n',                   // End of line character (default: '\\r\\n')\n  update: true,                // Enable update mode (default: false)\n);\n```\n\n#### CSV with Quoted Fields\n\n```dart\nvar csvContent = '''Name,Description,Salary\n\"Smith, John\",\"Senior Developer\",85000\n\"Doe, Jane\",\"Marketing Manager\",75000\n\"Johnson, Mike\",\"HR Director \"\"People Ops\"\"\",90000''';\n\nvar decoder = TableParser.decodeCsv(csvContent, textDelimiter: '\"');\nvar table = decoder.tables['Sheet1']!;\n\n// Properly handles quoted fields with embedded commas and escaped quotes\nprint(table.rows[1]); // [Smith, John, Senior Developer, 85000]\n```\n\n#### CSV Data Manipulation\n\n```dart\nvar decoder = TableParser.decodeCsv(csvContent, update: true);\n\n// Update existing cell\ndecoder.updateCell('Sheet1', 1, 1, 31); // Update age in row 1\n\n// Insert new row\ndecoder.insertRow('Sheet1', 1);\ndecoder.updateCell('Sheet1', 0, 1, 'New Name');\ndecoder.updateCell('Sheet1', 1, 1, 28);\n\n// Export back to CSV\nvar updatedCsvBytes = decoder.encode();\nFile('updated.csv').writeAsBytesSync(updatedCsvBytes);\n```\n\n### Excel (XLSX) and OpenDocument (ODS) Files\n\n#### Reading Files\n\n```dart\nimport 'dart:io';\nimport 'package:table_parser/table_parser.dart';\n\nvoid main() {\n  // Read from file\n  var bytes = File('spreadsheet.xlsx').readAsBytesSync();\n  var decoder = TableParser.decodeBytes(bytes, update: true);\n  \n  // Access sheets\n  for (var sheetName in decoder.tables.keys) {\n    var table = decoder.tables[sheetName]!;\n    print('Sheet: $sheetName');\n    print('Dimensions: ${table.maxRows} rows × ${table.maxCols} columns');\n    \n    // Access cell data\n    for (int i = 0; i \u003c table.maxRows; i++) {\n      print('Row $i: ${table.rows[i]}');\n    }\n  }\n}\n```\n\n#### Modifying Spreadsheets\n\n```dart\n// Update existing data\ndecoder.updateCell('Sheet1', 0, 0, 'New Header');\ndecoder.updateCell('Sheet1', 1, 1, 42.5);\n\n// Insert new rows/columns\ndecoder.insertRow('Sheet1', 1);\ndecoder.insertColumn('Sheet1', 0);\n\n// Save modified spreadsheet\nvar modifiedBytes = decoder.encode();\nFile('modified_spreadsheet.xlsx').writeAsBytesSync(modifiedBytes);\n```\n\n### Web Usage (Client-side)\n\n```dart\nimport 'dart:html';\nimport 'package:table_parser/table_parser.dart';\n\nvoid handleFileUpload(File file) {\n  var reader = FileReader();\n  reader.onLoadEnd.listen((event) {\n    var decoder = TableParser.decodeBytes(reader.result as List\u003cint\u003e);\n    var table = decoder.tables['Sheet1']!;\n    \n    // Process spreadsheet data\n    for (var row in table.rows) {\n      print(row);\n    }\n  });\n  reader.readAsArrayBuffer(file);\n}\n```\n\n## Command Line Tool\n\nThis package includes a command-line tool for inspecting table files:\n\n```bash\n# Basic usage\ndart run table_parser:dump_content data.xlsx\n\n# With specific sheet\ndart run table_parser:dump_content data.xlsx Sheet1\n\n# CSV with custom options\ndart run table_parser:dump_content data.csv --separator=; --delimiter=\"\n\n# Show help\ndart run table_parser:dump_content\n```\n\n## Supported Formats\n\n| Format | Extension | Read | Write | Notes |\n|--------|-----------|------|-------|-------|\n| CSV | `.csv` | ✅ | ✅ | Full support with custom separators and quoted fields |\n| Excel | `.xlsx` | ✅ | ✅ | Modern Excel format |\n| OpenDocument | `.ods` | ✅ | ✅ | LibreOffice/OpenOffice format |\n\n## API Reference\n\n### TableParser Class\n\n#### Factory Constructors\n\n- `TableParser.decodeBytes(List\u003cint\u003e bytes, {bool update = false})` - Decode XLSX/ODS from bytes\n- `TableParser.decodeCsv(String csvContent, {...})` - Decode CSV from string\n- `TableParser.decodeCsvBytes(List\u003cint\u003e bytes, {...})` - Decode CSV from bytes\n\n#### CSV Options\n\n- `separator` - Field separator character (default: `,`)\n- `textDelimiter` - Text delimiter for quoted fields (default: `null`)\n- `shouldParseNumbers` - Auto-parse numbers (default: `true`)\n- `eol` - End of line character (default: `\\r\\n`)\n- `update` - Enable modification support (default: `false`)\n\n#### Methods\n\n- `updateCell(String sheet, int column, int row, dynamic value)` - Update cell value\n- `insertRow(String sheet, int rowIndex)` - Insert new row\n- `insertColumn(String sheet, int columnIndex)` - Insert new column\n- `removeRow(String sheet, int rowIndex)` - Remove row\n- `removeColumn(String sheet, int columnIndex)` - Remove column\n- `encode()` - Export back to bytes\n\n### TableSheet Class\n\n#### Properties\n\n- `maxRows` - Number of rows\n- `maxCols` - Number of columns\n- `rows` - List of row data\n\n## Examples\n\nSee the [example](example/) folder for comprehensive usage examples:\n\n- Basic CSV, XLSX, and ODS parsing\n- Advanced CSV features (custom separators, quoted fields)\n- Data manipulation and export\n- Error handling\n\nRun the example:\n\n```bash\ndart run example/table_parser_example.dart\n```\n\n## Features and Limitations\n\n### ✅ Supported Features\n\n- **CSV**: Complete support including custom separators, quoted fields, escape sequences\n- **XLSX/ODS**: Read and write with full data type support\n- **Data Types**: Automatic detection and preservation of numbers, booleans, strings\n- **Modification**: Insert/remove rows and columns, update cells\n- **Export**: Save modified data back to original format\n- **Memory Efficient**: Streaming parsing for large files\n\n### ❌ Current Limitations\n\n- Annotations and comments are not preserved\n- Spanned (merged) rows and columns are not supported\n- Hidden rows and columns are visible in output\n- XLSX: Only native Excel date/time formats (not custom formats)\n- ODS: LibreOffice-specific formatting may not be preserved\n\n## Migration from spreadsheet_decoder\n\nThis package maintains API compatibility with spreadsheet_decoder. To migrate:\n\n1. Update your dependency:\n\n   ```yaml\n   dependencies:\n     table_parser: ^1.0.0  # instead of spreadsheet_decoder\n   ```\n\n2. Update imports:\n\n   ```dart\n   import 'package:table_parser/table_parser.dart';  // instead of spreadsheet_decoder\n   ```\n\n3. Update class names:\n\n   ```dart\n   TableParser.decodeBytes(bytes);     // instead of SpreadsheetDecoder\n   TableSheet table = decoder.tables;  // instead of SpreadsheetTable\n   ```\n\n## Contributing\n\nContributions are welcome! This package builds upon the excellent foundation of [spreadsheet_decoder](https://pub.dev/packages/spreadsheet_decoder) and aims to extend its capabilities while maintaining compatibility.\n\n### Development\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Ensure all tests pass: `dart test`\n6. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nThis package extends and modifies the original [spreadsheet_decoder](https://pub.dev/packages/spreadsheet_decoder) package by Sébastien Stehly, also licensed under the MIT License.\n\n## Credits\n\n- **Original Package**: [spreadsheet_decoder](https://pub.dev/packages/spreadsheet_decoder) by Sébastien Stehly\n- **Extended Version**: Table Parser - Enhanced with CSV support and additional features\n- **Contributors**: Thank you to all contributors who help improve this package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftegarnugroho%2Ftable_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftegarnugroho%2Ftable_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftegarnugroho%2Ftable_parser/lists"}