Skip to content
/ fastsheet Public

FastSheet is the fastest XLSX file parser for Ruby (at the time of release). It leverages a Rust library for high-performance parsing, making it significantly faster than other available solutions.

License

Notifications You must be signed in to change notification settings

dmk/fastsheet

Repository files navigation

Fastsheet

Fastest ruby gem for reading Excel documents.

Installation

You should have Rust installed to build this gem. Tested with Ruby 3.2+.

Add this line to your application's Gemfile:

gem 'fastsheet'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fastsheet

Usage

Open a sheet:

require 'fastsheet'

sheet = Fastsheet::Sheet.new('path/to/sheet.xlsx')

# number of columns
sheet.width

# number of rows
sheet.height

Get rows or columns:

sheet.rows
sheet.row(42)
sheet.column(1)

Iterators (returns enumerator if no block given):

sheet.each_row { |r| ... }
sheet.each_column { |c| ... }
sheet.each_column.to_a # materialize columns if you need them all

That's all API for now. Dates and formula are currently returned as nil. Feel free to open an issue if you need more.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dkkoval/fastsheet.

License

The gem is available as open source under the terms of the MIT License.

About

FastSheet is the fastest XLSX file parser for Ruby (at the time of release). It leverages a Rust library for high-performance parsing, making it significantly faster than other available solutions.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •