{"id":51355277,"url":"https://github.com/flopp/go-googlesheetswrapper","last_synced_at":"2026-07-02T19:08:53.307Z","repository":{"id":349536167,"uuid":"1202751358","full_name":"flopp/go-googlesheetswrapper","owner":"flopp","description":"Small read-only wrapper around the official Google Sheets API for Go.","archived":false,"fork":false,"pushed_at":"2026-04-06T11:28:12.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T13:26:45.710Z","etag":null,"topics":["go","golang","google","sheets"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"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/flopp.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-06T11:08:42.000Z","updated_at":"2026-04-06T11:54:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/flopp/go-googlesheetswrapper","commit_stats":null,"previous_names":["flopp/go-googlesheetswrapper"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/flopp/go-googlesheetswrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-googlesheetswrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-googlesheetswrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-googlesheetswrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-googlesheetswrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flopp","download_url":"https://codeload.github.com/flopp/go-googlesheetswrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flopp%2Fgo-googlesheetswrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35059395,"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-02T02:00:06.368Z","response_time":173,"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":["go","golang","google","sheets"],"created_at":"2026-07-02T19:08:51.300Z","updated_at":"2026-07-02T19:08:53.300Z","avatar_url":"https://github.com/flopp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-googlesheetswrapper\n\nSmall read-only wrapper around the official Google Sheets API for Go.\n\n## Features\n\n- Read-only API only (no mutations)\n- List sheet names\n- Read one sheet as `[][]string`\n- Read all sheets as `map[string][][]string`\n- Built-in mock client for tests/CI\n- Load mock data from JSON\n- `context.Context` support for cancellation/timeouts\n\n## Install\n\n```bash\ngo get github.com/flopp/go-googlesheetswrapper\n```\n\n## Real Google Sheets Client\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\tgooglesheetswrapper \"github.com/flopp/go-googlesheetswrapper\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tclient, err := googlesheetswrapper.New(\"YOUR_API_KEY\", \"YOUR_SHEET_ID\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tnames, err := client.ListSheets(ctx)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Printf(\"sheets: %v\", names)\n\n\trows, err := client.ReadSheet(ctx, names[0])\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Printf(\"first sheet rows: %d\", len(rows))\n}\n```\n\n## Mock Client\n\n```go\nctx := context.Background()\n\nclient := googlesheetswrapper.NewMock(map[string][][]string{\n\t\"Events\": {\n\t\t{\"DATE\", \"NAME\"},\n\t\t{\"2026-04-06\", \"Community Run\"},\n\t},\n})\n\nrows, err := client.ReadSheet(ctx, \"Events\")\n```\n\n## Mock From JSON\n\n```go\nclient, err := googlesheetswrapper.NewMockFromJSONFile(\"testdata/sheets.json\")\n```\n\nJSON format:\n\n```json\n{\n  \"Sheet1\": [[\"A1\", \"B1\"], [\"A2\", \"B2\"]],\n  \"Sheet2\": [[\"X1\"]]\n}\n```\n\n## Extracting and Validating Headers\n\nYou can validate and extract a header row (first row) from a sheet using `ExtractHeader`:\n\n```go\nrows, err := client.ReadSheet(ctx, \"Events\")\nif err != nil {\n\tlog.Fatal(err)\n}\n\nheaderIdx, err := googlesheetswrapper.ExtractHeader(rows, []string{\"DATE\", \"NAME\"}, false)\nif err != nil {\n\tlog.Fatalf(\"invalid header: %v\", err)\n}\n// headerIdx[\"DATE\"] == 0, headerIdx[\"NAME\"] == 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflopp%2Fgo-googlesheetswrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflopp%2Fgo-googlesheetswrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflopp%2Fgo-googlesheetswrapper/lists"}