A lightweight Go library for reading Excel files as relational data tables, simplifying configuration parsing.
go-excel is a Go library that reads Excel (.xlsx) files and parses them into structured Go data types like structs, slices, and maps. It solves the problem of efficiently importing tabular data from Excel for configuration or data processing tasks, using a relational database-like approach.
Go developers who need to import configuration data from Excel files, especially in scenarios where non-technical users maintain data in spreadsheet format.
It is lighter and faster than full-featured Excel libraries, focusing solely on reading relational data with intuitive struct mapping, making it ideal for configuration parsing without unnecessary overhead.
A simple and light excel file reader to read a standard excel as a table faster | 一个轻量级的Excel数据读取库,用一种更关系数据库的方式解析Excel。
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Maps Excel rows to Go structs using xlsx tags similar to database ORMs, as shown in the example with column and split tags, making it intuitive for developers familiar with ORM patterns.
Supports custom unmarshalers via encoding.BinaryUnmarshaler and JSON encoding, allowing complex data like JSON strings in cells to be parsed directly into structs, demonstrated in the Standard struct example.
Allows specifying title rows, skipping rows, and setting default values for empty cells through the Config struct, providing fine-grained control over data import without manual parsing.
Can read into structs, slices of strings, or maps with string keys, offering versatility for different use cases, such as quick data inspection or structured processing.
Can open and read Excel files directly from binary data in memory using OpenBinary, useful for handling files from network streams or embedded resources without disk I/O.
The library is designed solely for reading Excel files; it lacks any capabilities for creating or modifying spreadsheets, which limits its use in applications needing data export or updates.
Only supports .xlsx files and not the older .xls format, potentially excluding legacy data sources and requiring file conversion for compatibility.
Setting up custom field configs via GetXLSXFieldConfigs interface or handling escape characters adds complexity beyond basic usage, as noted in the README for advanced scenarios.
The roadmap lists planned features like reading into map by primary key, indicating that some advanced relational mappings are not yet implemented, which could delay projects needing those capabilities.