{"id":49233136,"url":"https://github.com/mukbeast4/go-ods","last_synced_at":"2026-04-24T13:01:18.251Z","repository":{"id":344225923,"uuid":"1181018472","full_name":"Mukbeast4/go-ods","owner":"Mukbeast4","description":"Pure Go library for reading, writing, and evaluating ODS (OpenDocument Spreadsheet)  files","archived":false,"fork":false,"pushed_at":"2026-04-24T11:23:47.000Z","size":321,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T12:11:12.054Z","etag":null,"topics":["document","excel","excelize","file-format","formula-engine","formulas","go","golang","libreoffice","ods","opendocument","pure-go","spreadsheet","xlsx","zero-dependencies"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Mukbeast4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2026-03-13T16:56:44.000Z","updated_at":"2026-04-24T11:22:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Mukbeast4/go-ods","commit_stats":null,"previous_names":["mukbeast4/go-ods"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Mukbeast4/go-ods","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukbeast4%2Fgo-ods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukbeast4%2Fgo-ods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukbeast4%2Fgo-ods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukbeast4%2Fgo-ods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mukbeast4","download_url":"https://codeload.github.com/Mukbeast4/go-ods/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukbeast4%2Fgo-ods/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32224413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["document","excel","excelize","file-format","formula-engine","formulas","go","golang","libreoffice","ods","opendocument","pure-go","spreadsheet","xlsx","zero-dependencies"],"created_at":"2026-04-24T13:00:57.850Z","updated_at":"2026-04-24T13:01:18.238Z","avatar_url":"https://github.com/Mukbeast4.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-ods\n\n[![CI](https://github.com/Mukbeast4/go-ods/actions/workflows/ci.yml/badge.svg)](https://github.com/Mukbeast4/go-ods/actions/workflows/ci.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/mukbeast4/go-ods.svg)](https://pkg.go.dev/github.com/mukbeast4/go-ods)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mukbeast4/go-ods)](https://goreportcard.com/report/github.com/mukbeast4/go-ods)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Release](https://img.shields.io/github/v/release/Mukbeast4/go-ods)](https://github.com/Mukbeast4/go-ods/releases)\n\nPure Go library for reading, writing, and evaluating ODS (OpenDocument Spreadsheet) files. Zero external dependencies, no LibreOffice required.\n\n## Features\n\n- Read and write `.ods` files (OpenDocument Spreadsheet)\n- Cell value management with typed getters/setters (string, int, float, bool, date)\n- Formula evaluation engine with 45+ spreadsheet functions\n- Formula recalculation with dependency graph and circular reference detection\n- Auto-recalc mode: formulas update automatically when cell values change\n- Sheet management (create, copy, rename, delete)\n- Row and column operations (insert, remove, resize, hide/show)\n- Column auto-fit (optimal width)\n- Cell merging and unmerging\n- Cell styling (font, fill, border, alignment)\n- Sheet and cell protection\n- Conditional formatting (calcext namespace)\n- Auto-filter with filter criteria and sort keys\n- Embedded images (PNG, JPEG, GIF, BMP) anchored to cells\n- Streaming row iterator for large files\n- Document properties (title, creator, description)\n\n## Requirements\n\n- Go 1.23+\n\n## Installation\n\n```bash\ngo get github.com/mukbeast4/go-ods\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\tods \"github.com/mukbeast4/go-ods\"\n)\n\nfunc main() {\n\tf := ods.NewFile()\n\n\tf.SetCellValue(\"Sheet1\", \"A1\", \"Product\")\n\tf.SetCellValue(\"Sheet1\", \"B1\", \"Price\")\n\tf.SetCellFloat(\"Sheet1\", \"A2\", 10)\n\tf.SetCellFloat(\"Sheet1\", \"A3\", 20)\n\tf.SetCellFloat(\"Sheet1\", \"A4\", 30)\n\n\tf.SetCellFormula(\"Sheet1\", \"A5\", \"SUM([.A2:.A4])\")\n\tf.RecalcSheet(\"Sheet1\")\n\n\tval, _ := f.GetCellFloat(\"Sheet1\", \"A5\")\n\tfmt.Println(\"Sum:\", val) // Sum: 60\n\n\tif err := f.SaveAs(\"output.ods\"); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n## Formula Evaluation\n\nThe built-in formula engine supports evaluation without LibreOffice:\n\n```go\nf := ods.NewFile()\n\nf.SetCellFloat(\"Sheet1\", \"A1\", 100)\nf.SetCellFormula(\"Sheet1\", \"B1\", \"[.A1]*1.2\")\nf.SetCellFormula(\"Sheet1\", \"C1\", \"IF([.B1]\u003e100;\\\"over\\\";\\\"under\\\")\")\n\nf.RecalcAll()\n\nb1, _ := f.GetCellFloat(\"Sheet1\", \"B1\")   // 120\nc1, _ := f.GetCellValue(\"Sheet1\", \"C1\")   // \"over\"\n```\n\n### Auto-Recalc\n\nEnable automatic formula recalculation when cell values change:\n\n```go\nf.SetAutoRecalc(true)\n\nf.SetCellFloat(\"Sheet1\", \"A1\", 50)\n// All dependent formulas are recalculated immediately\n```\n\n### Supported Functions\n\n| Category | Functions |\n|----------|-----------|\n| Math | `SUM`, `AVERAGE`, `MIN`, `MAX`, `ABS`, `ROUND`, `FLOOR`, `CEIL`, `INT`, `MOD`, `POWER`, `SQRT`, `RAND`, `RANDBETWEEN` |\n| Logic | `IF`, `IFS`, `SWITCH`, `AND`, `OR`, `NOT`, `IFERROR` |\n| Text | `CONCATENATE`, `LEN`, `TRIM`, `UPPER`, `LOWER`, `LEFT`, `RIGHT`, `MID`, `FIND`, `SEARCH`, `SUBSTITUTE`, `REPLACE`, `TEXT`, `VALUE` |\n| Stats | `COUNT`, `COUNTA`, `COUNTIF`, `COUNTIFS`, `MEDIAN`, `STDEV`, `STDEVP`, `VAR`, `VARP`, `RANK`, `LARGE`, `SMALL`, `PERCENTILE` |\n| Conditional | `SUMIF`, `SUMIFS`, `SUMPRODUCT` |\n| Lookup | `VLOOKUP`, `HLOOKUP`, `XLOOKUP`, `INDEX`, `MATCH` |\n| Date/Time | `DATE`, `TODAY`, `NOW`, `YEAR`, `MONTH`, `DAY` |\n\n## Typed Cell Helpers\n\nConvenience wrappers for the most common number formats:\n\n```go\nf.SetCellCurrency(\"Sheet1\", \"A1\", 1234.5, \"$\")     // \"$1,234.50\"\nf.SetCellCurrency(\"Sheet1\", \"A2\", 999.99, \"€\")     // \"€999.99\"\n\nf.SetCellPercentage(\"Sheet1\", \"B1\", 0.25, 0)       // \"25%\"\nf.SetCellPercentage(\"Sheet1\", \"B2\", 0.3333, 2)     // \"33.33%\"\n\nt := time.Date(2024, 3, 15, 9, 30, 0, 0, time.UTC)\nf.SetCellDateTime(\"Sheet1\", \"C1\", t, \"DD/MM/YYYY\")\n\nf.SetCellDuration(\"Sheet1\", \"D1\", 90*time.Minute)  // stored as PT1H30M0S\n```\n\n## Reading ODS Files\n\n```go\nf, err := ods.OpenFile(\"spreadsheet.ods\")\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer f.Close()\n\nval, _ := f.GetCellValue(\"Sheet1\", \"A1\")\nrows, _ := f.GetRows(\"Sheet1\")\n\nfor _, row := range rows {\n\tfmt.Println(row)\n}\n```\n\n## Sheet Operations\n\n```go\nf.NewSheet(\"Data\")\nf.SetSheetName(\"Sheet1\", \"Summary\")\nf.CopySheet(\"Data\", \"DataBackup\")\nf.DeleteSheet(\"DataBackup\")\n\nsheets := f.GetSheetList() // [\"Summary\", \"Data\"]\n```\n\n## Cell Styling\n\n```go\nstyle := \u0026ods.Style{\n\tFont: \u0026ods.Font{\n\t\tFamily:             \"Arial\",\n\t\tSize:               \"12pt\",\n\t\tBold:               \"bold\",\n\t\tColor:              \"#FF0000\",\n\t\tStrikethrough:      true,\n\t\tStrikethroughColor: \"#000000\",\n\t\tVerticalAlign:      \"super\", // or \"sub\"\n\t},\n\tFill: \u0026ods.Fill{Color: \"#FFFF00\"},\n\tAlignment: \u0026ods.Alignment{\n\t\tHorizontal: \"center\",\n\t\tRotation:   45,  // degrees (0-360, negatives are normalized)\n\t\tIndent:     2,   // 0.25cm increments\n\t},\n}\n\nstyleID, _ := f.NewStyle(style)\nf.SetCellStyle(\"Sheet1\", \"A1\", \"A1\", styleID)\n```\n\n## Row and Column Operations\n\n```go\nf.InsertRows(\"Sheet1\", 3, 2)       // Insert 2 rows at row 3\nf.RemoveRow(\"Sheet1\", 5)           // Remove row 5\nf.SetColWidth(\"Sheet1\", \"B\", 5.0)  // Set column B width\n\nf.SetRowVisible(\"Sheet1\", 2, false)  // Hide row 2\nf.SetColVisible(\"Sheet1\", \"C\", false) // Hide column C\nf.SetColAutoFit(\"Sheet1\", \"A\", true)  // Auto-fit column A width\nf.SetRowAutoFit(\"Sheet1\", 1, true)    // Auto-fit row 1 height\n```\n\n## Sheet Protection\n\n```go\nf.SetSheetProtection(\"Sheet1\", true)\n\nprotected, _ := f.IsSheetProtected(\"Sheet1\") // true\n\nlocked := true\nstyleID, _ := f.NewStyle(\u0026ods.Style{\n\tProtected: \u0026locked,\n})\nf.SetCellStyle(\"Sheet1\", \"A1\", \"A1\", styleID)\n```\n\n## Conditional Formatting\n\n```go\nrules := []ods.ConditionalRule{\n\t{Value: \"of:cell-content()\u003e90\", StyleName: \"good\", BaseCellAddress: \"Sheet1.A1\"},\n\t{Value: \"of:cell-content()\u003c50\", StyleName: \"bad\", BaseCellAddress: \"Sheet1.A1\"},\n}\nf.SetConditionalFormat(\"Sheet1\", \"A1:A100\", rules)\n\nformats, _ := f.GetConditionalFormats(\"Sheet1\")\nf.RemoveConditionalFormat(\"Sheet1\", \"A1:A100\")\n```\n\n## Auto-Filter, Filter Criteria and Sort\n\n```go\nf.SetAutoFilter(\"Sheet1\", \"A1\", \"D100\")\n\nf.SetFilterCriteria(\"Sheet1\", []ods.FilterCriteria{\n\t{Column: 0, Values: []string{\"Alice\"}},\n})\n\nf.SetSort(\"Sheet1\", []ods.SortKey{\n\t{Column: 1, Descending: true},\n})\n\ncriteria, _ := f.GetFilterCriteria(\"Sheet1\")\nsortKeys, _ := f.GetSort(\"Sheet1\")\n\nf.ClearFilterCriteria(\"Sheet1\")\nf.RemoveSort(\"Sheet1\")\n```\n\n## Embedded Images\n\nAnchor images (PNG, JPEG, GIF, BMP) to any cell. Format is auto-detected, dimensions are in centimeters, identical binaries are deduplicated.\n\n```go\nf.AddImage(\"Sheet1\", \"B2\", \"logo.png\", \u0026ods.ImageOptions{Width: 4, Height: 3})\n\ndata, _ := os.ReadFile(\"chart.jpg\")\nf.AddImageFromBytes(\"Sheet1\", \"D5\", data, \u0026ods.ImageOptions{\n\tWidth: 6, Height: 4, OffsetX: 0.5, OffsetY: 0.25,\n})\n\nimages, _ := f.GetImages(\"Sheet1\")\nfor _, img := range images {\n\tfmt.Printf(\"%s: %s %vx%vcm\\n\", img.CellRef, img.Format, img.Width, img.Height)\n}\n\nf.RemoveImages(\"Sheet1\", \"B2\")\n```\n\n## Examples\n\nA collection of runnable samples lives under [`examples/`](examples). Each sub-directory is a standalone `main` package:\n\n```bash\ngo run ./examples/quickstart   # cells, formula, save\ngo run ./examples/formulas     # aggregation functions\ngo run ./examples/styling      # fonts, fills, borders, rotation\ngo run ./examples/autofilter   # filter + sort\ngo run ./examples/streaming    # 10k rows via AppendRows + RowIterator\ngo run ./examples/roundtrip    # open -\u003e mutate -\u003e save\ngo run ./examples/images       # embed a PNG\n```\n\nSee [examples/README.md](examples/README.md) for a breakdown of each sample.\n\n## Contributing\n\nWe welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) before submitting a pull request.\n\n## Security\n\nTo report a security vulnerability, please see our [Security Policy](SECURITY.md).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmukbeast4%2Fgo-ods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmukbeast4%2Fgo-ods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmukbeast4%2Fgo-ods/lists"}