{"id":22173872,"url":"https://github.com/9d4/ekelesek","last_synced_at":"2025-03-24T18:14:26.216Z","repository":{"id":184336302,"uuid":"671525052","full_name":"9d4/ekelesek","owner":"9d4","description":"Wrapper around excelize","archived":false,"fork":false,"pushed_at":"2023-09-21T03:36:03.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T22:46:14.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/9d4.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-07-27T14:12:52.000Z","updated_at":"2023-07-28T22:45:40.000Z","dependencies_parsed_at":"2024-12-02T09:02:41.198Z","dependency_job_id":null,"html_url":"https://github.com/9d4/ekelesek","commit_stats":null,"previous_names":["9d4/ekelesek"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9d4%2Fekelesek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9d4%2Fekelesek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9d4%2Fekelesek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9d4%2Fekelesek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9d4","download_url":"https://codeload.github.com/9d4/ekelesek/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245325223,"owners_count":20596818,"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":[],"created_at":"2024-12-02T07:36:02.049Z","updated_at":"2025-03-24T18:14:26.194Z","avatar_url":"https://github.com/9d4.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ekelesek\n\nExtract xlsx to struct with [excelize](github.com/xuri/excelize).\n\n## Usage\n\n| Age | Name           | Birth Day |\n| --- | -------------- | --------- |\n| 26  | Kaye Goff      | April     |\n| 22  | Adrienne Kirby | May       |\n| 27  | John           | May       |\n\nMake new type struct.\n\n```go\ntype Student struct {\n\tName     string `lookup:\"name\"`\n\tAge      int    `lookup:\"age\"`\n\tBirthDay string `lookup:\"birthday\"`\n}\n```\n\nMap the xlsx column.\n\n```go\nvar lookupMap = map[string]string{\n\t\"Name\":      \"name\",\n\t\"Age\":       \"age\",\n\t\"Birth Day\": \"birthday\",\n}\n```\n\nThe key is the column name in the table and the value is the lookup key for Student struct.\n\nFull example see in example directory or below code.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/9d4/ekelesek/eksel\"\n\t\"github.com/xuri/excelize/v2\"\n)\n\nvar lookupMap = map[string]string{\n\t\"Name\":      \"name\",\n\t\"Age\":       \"age\",\n\t\"Birth Day\": \"birthday\",\n}\n\ntype Student struct {\n\tName     string `lookup:\"name\"`\n\tAge      int    `lookup:\"age\"`\n\tBirthDay string `lookup:\"birthday\"`\n}\n\nfunc main() {\n\tf, _ := excelize.OpenFile(\"./data.xlsx\")\n\trows, _ := f.Rows(\"Sheet1\")\n\n\tvar students []Student\n\teksel.Parse(rows, lookupMap, \u0026students)\n\n\tfor _, student := range students {\n\t\tfmt.Printf(\"Name: %s\\nAge: %d\\nBirthday: %s\\n\\n\", student.Name, student.Age, student.BirthDay)\n\t}\n}\n```\n\n### Supported type\n- Int\n- Float\n- Uint\n- Bool\n- Time\n\n\u003e Note: The code is not well tested, I only use this for string, int, and datetime type.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9d4%2Fekelesek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9d4%2Fekelesek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9d4%2Fekelesek/lists"}