All Projects → Iwark → Spreadsheet

Iwark / Spreadsheet

Licence: mit
Google Go (golang) library for reading and writing spreadsheet files on Google Docs.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Spreadsheet

fxl.js
ƛ fxl.js is a data-oriented JavaScript spreadsheet library. It provides a way to build spreadsheets using modular, lego-like blocks.
Stars: ✭ 27 (-90.53%)
Mutual labels:  spreadsheet
lifebot
Use Google Sheets to log your life by texting it Emojis and pulling in data from Fitbit automatically.
Stars: ✭ 15 (-94.74%)
Mutual labels:  spreadsheet
vim-colddeck
Vim single-column spreadsheet with RPN
Stars: ✭ 21 (-92.63%)
Mutual labels:  spreadsheet
osu-cs-class-explorer
Angular-based web app allows OSU eCampus CS students to view candid class reviews from past students. Data scraped from OSU subreddit survey.
Stars: ✭ 24 (-91.58%)
Mutual labels:  spreadsheet
Personal-Finance-Net-Worth-Tracker
Personal Finance (Net Worth Tracker) Wealth Management Spreadsheet
Stars: ✭ 31 (-89.12%)
Mutual labels:  spreadsheet
XToolset
Typed import, and export XLSX spreadsheet to JS / TS. Template-based create, render, and export data into excel files.
Stars: ✭ 110 (-61.4%)
Mutual labels:  spreadsheet
react-gridsheet
React component like SpreadSheet
Stars: ✭ 121 (-57.54%)
Mutual labels:  spreadsheet
Unioffice
Pure go library for creating and processing Office Word (.docx), Excel (.xlsx) and Powerpoint (.pptx) documents
Stars: ✭ 3,111 (+991.58%)
Mutual labels:  spreadsheet
Social-Media-Monitor
Automatically monitor and log fan counters from social media(Facebook Pages, Twitter, Instagram, YouTube, Google+, OneSignal, Alexa) using APIs to Google Spreadsheet. Very useful for website admins and social media managers.
Stars: ✭ 36 (-87.37%)
Mutual labels:  spreadsheet
EPPlus4PHP
an easy-to-use excel library for php project which is compiled with peachpie. NOT FOR THE COMMON PHP PROJECT!
Stars: ✭ 15 (-94.74%)
Mutual labels:  spreadsheet
account
📚️ ➕ 🔢 Tell little stories with numbers
Stars: ✭ 94 (-67.02%)
Mutual labels:  spreadsheet
google-spreadsheet-cli
📊 CLI for reading and writing data into Google Spreadsheet
Stars: ✭ 51 (-82.11%)
Mutual labels:  spreadsheet
excel validator
Python script to validate data in Excel files
Stars: ✭ 14 (-95.09%)
Mutual labels:  spreadsheet
OpenWebSheet
OpenSource Web based spreadsheet
Stars: ✭ 30 (-89.47%)
Mutual labels:  spreadsheet
rowy
Open-source Airtable-like experience for your database (Firestore) with GCP's scalability. Build any automation or cloud functions for your product. ⚡️✨
Stars: ✭ 2,676 (+838.95%)
Mutual labels:  spreadsheet
dynamic-table
Dynamic Table jQuery Plug-in - A table that can be sorted, filtered and edited, similar to common spreadsheet application.
Stars: ✭ 26 (-90.88%)
Mutual labels:  spreadsheet
workbook
simple framework for containing spreadsheet like data
Stars: ✭ 13 (-95.44%)
Mutual labels:  spreadsheet
Jamovi
jamovi - open software to bridge the gap between researcher and statistician
Stars: ✭ 277 (-2.81%)
Mutual labels:  spreadsheet
jupyterlab-spreadsheet-editor
JupyterLab spreadsheet editor for tabular data (e.g. csv, tsv)
Stars: ✭ 72 (-74.74%)
Mutual labels:  spreadsheet
ExcelFormulaBeautifier
Excel Formula Beautifer,make Excel formulas more easy to read,Excel公式格式化/美化,将Excel公式转为易读的排版
Stars: ✭ 27 (-90.53%)
Mutual labels:  spreadsheet

spreadsheet

Build Status Coverage Status GoReport GoDoc License

Package spreadsheet provides fast and easy-to-use access to the Google Sheets API for reading and updating spreadsheets.

Any pull-request is welcome.

Installation

go get gopkg.in/Iwark/spreadsheet.v2

Preparation

This package uses oauth2 client for authentication. You need to get service account key from Google Developer Console. Place the client_secret.json to the root of your project.

Usage

First you need service to start using this package.

data, err := ioutil.ReadFile("client_secret.json")
checkError(err)

conf, err := google.JWTConfigFromJSON(data, spreadsheet.Scope)
checkError(err)

client := conf.Client(context.TODO())
service := spreadsheet.NewServiceWithClient(client)

Or there is a shortcut which does the same things:

service, err := spreadsheet.NewService()

Fetching a spreadsheet

spreadsheetID := "1mYiA2T4_QTFUkAXk0BE3u7snN2o5FgSRqxmRrn_Dzh4"
spreadsheet, err := service.FetchSpreadsheet(spreadsheetID)

Create a spreadsheet

ss, err := service.CreateSpreadsheet(spreadsheet.Spreadsheet{
	Properties: spreadsheet.Properties{
		Title: "spreadsheet title",
	},
})

Find a sheet

// get a sheet by the index.
sheet, err := spreadsheet.SheetByIndex(0)

// get a sheet by the ID.
sheet, err := spreadsheet.SheetByID(0)

// get a sheet by the title.
sheet, err := spreadsheet.SheetByTitle("SheetTitle")

Get cells

// get the B1 cell content
sheet.Rows[0][1].Value

// get the A2 cell content
sheet.Columns[0][1].Value

Update cell content

row := 1
column := 2
sheet.Update(row, column, "hogehoge")
sheet.Update(3, 2, "fugafuga")

// Make sure call Synchronize to reflect the changes.
err := sheet.Synchronize()

Expand a sheet

err := service.ExpandSheet(sheet, 20, 10) // Expand the sheet to 20 rows and 10 columns

Delete Rows / Columns

err := sheet.DeleteRows(0, 3) // Delete first three rows in the sheet

err := sheet.DeleteColumns(1, 4) // Delete columns B:D

More usage can be found at the godoc.

Example

package main

import (
	"fmt"
	"io/ioutil"

	"gopkg.in/Iwark/spreadsheet.v2"
	"golang.org/x/net/context"
	"golang.org/x/oauth2/google"
)

func main() {
	data, err := ioutil.ReadFile("client_secret.json")
	checkError(err)
	conf, err := google.JWTConfigFromJSON(data, spreadsheet.Scope)
	checkError(err)
	client := conf.Client(context.TODO())

	service := spreadsheet.NewServiceWithClient(client)
	spreadsheet, err := service.FetchSpreadsheet("1mYiA2T4_QTFUkAXk0BE3u7snN2o5FgSRqxmRrn_Dzh4")
	checkError(err)
	sheet, err := spreadsheet.SheetByIndex(0)
	checkError(err)
	for _, row := range sheet.Rows {
		for _, cell := range row {
			fmt.Println(cell.Value)
		}
	}

	// Update cell content
	sheet.Update(0, 0, "hogehoge")

	// Make sure call Synchronize to reflect the changes
	err = sheet.Synchronize()
	checkError(err)
}

func checkError(err error) {
	if err != nil {
		panic(err.Error())
	}
}

License

Spreadsheet is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].