{"id":47589710,"url":"https://github.com/fltoss/spreadsheet","last_synced_at":"2026-05-15T14:02:57.887Z","repository":{"id":285930995,"uuid":"959801978","full_name":"fltoss/spreadsheet","owner":"fltoss","description":"Elixir library for reading spreadsheets","archived":false,"fork":false,"pushed_at":"2026-05-12T15:36:29.000Z","size":144,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-12T17:19:58.951Z","etag":null,"topics":["csv","elixir","ods","spreadsheet","xlsx"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/spreadsheet","language":"Elixir","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/fltoss.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-04-03T11:28:07.000Z","updated_at":"2026-05-12T16:29:36.000Z","dependencies_parsed_at":"2025-04-25T08:23:57.892Z","dependency_job_id":"871c4333-33cd-42e5-aab5-6daad66314b0","html_url":"https://github.com/fltoss/spreadsheet","commit_stats":null,"previous_names":["wkirschbaum/ex_spreadsheet","floatpays/ex_spreadsheet","fltoss/spreadsheet"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/fltoss/spreadsheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fltoss%2Fspreadsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fltoss%2Fspreadsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fltoss%2Fspreadsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fltoss%2Fspreadsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fltoss","download_url":"https://codeload.github.com/fltoss/spreadsheet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fltoss%2Fspreadsheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33068894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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":["csv","elixir","ods","spreadsheet","xlsx"],"created_at":"2026-04-01T17:11:09.020Z","updated_at":"2026-05-15T14:02:57.868Z","avatar_url":"https://github.com/fltoss.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spreadsheet\n\n\u003c!-- MDOC !--\u003e\n\nA fast, memory-efficient Elixir library for parsing spreadsheet files powered by Rust and [Calamine](https://docs.rs/calamine/latest/calamine/).\n\n## Features\n\n- 🚀 **Fast Performance** - Native Rust implementation via NIFs for high-speed parsing\n- 📁 **Multiple Formats** - Supports .xls, .xla, .xlsx, .xlsm, .xlam, .xlsb, and .ods files\n- 💾 **Memory Efficient** - Parse from file paths or binary content\n- 🗂️ **Sheet Management** - List and filter sheet names, including hidden sheets\n- 📅 **Smart Type Handling** - Automatic conversion of dates to NaiveDateTime and numbers to Float\n- 🔧 **Simple API** - Clean, functional interface with {:ok, result} | {:error, reason} patterns\n\n## Usage\n\n### Getting Sheet Names\n\nList all sheet names from a file:\n\n```elixir\niex\u003e Spreadsheet.sheet_names(\"financial_data.xlsx\")\n{:ok, [\"Q1 Revenue\", \"Q2 Revenue\", \"Summary\"]}\n```\n\nOr from binary content using the `:format` option:\n\n```elixir\niex\u003e content = File.read!(\"financial_data.xlsx\")\niex\u003e Spreadsheet.sheet_names(content, format: :binary)\n{:ok, [\"Q1 Revenue\", \"Q2 Revenue\", \"Summary\"]}\n```\n\n### Filtering Hidden Sheets\n\nExclude hidden sheets from the results:\n\n```elixir\niex\u003e Spreadsheet.sheet_names(\"workbook.xlsx\", hidden: false)\n{:ok, [\"Visible Sheet\"]}\n```\n\n### Parsing Sheet Data\n\nParse a specific sheet by name from a file:\n\n```elixir\niex\u003e Spreadsheet.parse(\"sales.xlsx\", sheet: \"Q1 Data\")\n{:ok, [\n  [\"Product\", \"Sales\", \"Date\"],\n  [\"Widget A\", 1500.0, ~N[2024-01-15 00:00:00]],\n  [\"Widget B\", 2300.0, ~N[2024-01-20 00:00:00]]\n]}\n```\n\nParse all sheets from a file (returns a list of `{sheet_name, sheet_data}` tuples in order):\n\n```elixir\niex\u003e Spreadsheet.parse(\"sales.xlsx\")\n{:ok, [\n  {\"Q1 Data\", [\n    [\"Product\", \"Sales\", \"Date\"],\n    [\"Widget A\", 1500.0, ~N[2024-01-15 00:00:00]]\n  ]},\n  {\"Q2 Data\", [\n    [\"Product\", \"Sales\", \"Date\"],\n    [\"Widget B\", 2300.0, ~N[2024-04-15 00:00:00]]\n  ]}\n]}\n```\n\nOr from binary content using the `:format` option:\n\n```elixir\niex\u003e content = File.read!(\"sales.xlsx\")\niex\u003e Spreadsheet.parse(content, sheet: \"Q1 Data\", format: :binary)\n{:ok, [\n  [\"Product\", \"Sales\", \"Date\"],\n  [\"Widget A\", 1500.0, ~N[2024-01-15 00:00:00]],\n  [\"Widget B\", 2300.0, ~N[2024-01-20 00:00:00]]\n]}\n\n# Parse all sheets from binary\niex\u003e Spreadsheet.parse(content, format: :binary)\n{:ok, [\n  {\"Q1 Data\", [...]},\n  {\"Q2 Data\", [...]}\n]}\n```\n\n### Data Type Handling\n\nThe library automatically converts data types:\n- **Dates**: Converted to `NaiveDateTime` structs\n- **Numbers**: Converted to `Float` values\n- **Empty cells**: Returned as `nil`\n- **Text**: Returned as strings\n\nFor detailed information on the underlying parsing engine, see the [Calamine documentation](https://docs.rs/calamine/latest/calamine/).\n\n\u003c!-- MDOC !--\u003e\n\n## Installation\n\nAdd `spreadsheet` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:spreadsheet, \"~\u003e 0.4.0\"}\n  ]\nend\n```\n\n### No Rust Installation Required\n\nBy default, the library uses precompiled NIFs, so **you don't need Rust installed**. If you want to force compilation from source, set the application environment:\n\n```elixir\nconfig :rustler_precompiled, :force_build, spreadsheet: true\n```\n\n## Performance\n\nSpreadsheet is built for performance and handles large files efficiently:\n\n- **Native Speed**: Rust-powered parsing for maximum throughput\n- **Memory Efficient**: Streaming approach minimizes memory usage\n- **Cross-Platform**: Precompiled NIFs for major platforms (Linux, macOS, Windows)\n- **Production Ready**: Battle-tested in high-volume data processing environments\n\n### Benchmarks\n\nComprehensive benchmarks comparing Spreadsheet against other popular Elixir XLSX libraries show significant performance advantages:\n\n**Small Files (10 rows × 5 columns):**\n- **~11-12x faster** than pure Elixir implementations\n- **~160-600x less memory** usage\n\n**Large Files (10,000 rows × 20 columns):**\n- **~10-20x faster** parsing\n- **~200-1200x less memory** usage\n\nFor detailed benchmark results and methodology, see [benchmarks/RESULTS.md](benchmarks/RESULTS.md).\n\n## Why Spreadsheet?\n\nCompared to other Elixir spreadsheet libraries:\n\n- **Faster**: Native Rust implementation outperforms pure Elixir parsers\n- **More Formats**: Supports more file formats including .ods and legacy .xls files\n- **Better Memory Usage**: Efficient memory handling for large files\n- **Zero Setup**: No need to install external dependencies\n\n### Alternatives\n\n- [XlsxReader](https://hex.pm/packages/xlsx_reader) - Pure Elixir, XLSX only\n- [Xlsxir](https://hex.pm/packages/xlsxir) - XML-based parsing, XLSX only\n\n## Development\n\n### Publishing a new version\n\nFollow the [rustler_precompiled guide](https://hexdocs.pm/rustler_precompiled/precompilation_guide.html):\n\n1. Release a new tag\n2. Push the code with the new tag: `git push origin main --tags`\n3. Wait for all NIFs to be built\n4. Download precompiled NIFs: `mix rustler_precompiled.download Spreadsheet.Calamine --all`\n5. Release the package to Hex.pm\n\n\n## Copyright and License\n\nCopyright (c) 2025 Wilhelm H Kirschbaum\n\nThis work is free. You can redistribute it and/or modify it under the\nterms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffltoss%2Fspreadsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffltoss%2Fspreadsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffltoss%2Fspreadsheet/lists"}