Project

spreet

0.0
No commit activity in last 3 years
No release in over 3 years
Spr[eadsh]eet handler for CSV(RW), Excel CSV(RW) and ODS(RW). The goal is to read and write in many open formats.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

< 0.7.0
>= 4.0.0
>= 1.0.0
 Project Readme

Spreet¶ ↑

<img src=“https://badge.fury.io/rb/spreet.png” alt=“Gem Version” /> <img src=“https://secure.travis-ci.org/ekylibre/spreet.png”/>

Universal handler for spreets.

Compatible with Ruby ≥ 1.9.2.

Why ?¶ ↑

This gems is a handler for spreadsheets. With its independent API, it is possible to create, update files in some formats. Today the list is not very long:

  • CSV: UTF-8 with commas (Read & Write)

  • CSV for Excel: CP1252 with semicolons (Read & Write)

  • ODS: Open Document Format (Read & Write with restrictions)

Installation¶ ↑

gem install spreet

How to use it¶ ↑

# Create a new document
doc = Spreet::Document.new
sheet = doc.sheets.add "My Sheet"

# Coordinates can be called with spreadsheet style...
sheet["A1"] = "Last name"
# ...or more classic style...
sheet[1,0] = "First name"
# ...or if necessary as a Hash
sheet[x: 2, y: 0] = "Born on"

sheet.next_row
for person in People.all
  sheet.row person.last_name, person.first_name, person.born_on
end

# Write it as a classic CSV
sheet.write("people-1.csv")
# Write it as a CSV for Excel
sheet.write("people-2.csv", :format=>:xcsv) # CSV for Excel
# or write it as an Open Document Spreadsheet
sheet.write("people-3.ods")

# Read an existing document
doc = Spreet::Document.read("doc.ods")

To do¶ ↑

  • Add style management for cells

  • Add Header/Footer

  • HTML Writer

  • PDF Writer like LibreOffice would make it