Giter Site home page Giter Site logo

lpenap / gs-spreadsheet-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jsoma/gs-spreadsheet-manager

0.0 1.0 0.0 108 KB

A slightly more object-oriented, ORM-y, and altogether pleasant way of dealing with Google Spreadsheets when using Google Apps Script.

JavaScript 100.00%

gs-spreadsheet-manager's Introduction

gs-spreadsheet-manager

A slightly more pleasant way of dealing with Google Spreadsheets in Google Apps Script.

gs-managed-spreadsheet

An attempt to make the interface a little more object-oriented and ORM-y.

How to use

Let's say you have a spreadsheet with a worksheet called animals. It looks like this.

namedescriptioncount
KoalaThey eat a lot of eucalyptus55
TigerThey eat a lot of human beings2
// Let's get the animals worksheet
var spreadsheet = ManagedSpreadsheet('SPREADSHEET_KEY');
var worksheet = spreadsheet.sheet("animals");

// Let's grab the info on the tiger
var tiger = worksheet.find('name', 'Tiger')
// { name: 'Tiger', description: 'They eat a lot of human beings', count: 2 }

// Let's update the tiger's data
tiger.count = 7;
var index = worksheet.rowIndex('name', 'Tiger');
worksheet.update(rowIndex, tiger);

// Let's add another animal
worksheet.append({name: 'Weasel', description: 'Always weaseling around', count: 10});

// We no longer need animals we have less than 5 of
worksheet.deleteWhere( function(row) {
  return row.count < 5;
})

// Let's grab what's left
var everything = worksheet.all()
// [{name: 'Koala', description: 'They eat a lot of eucalyptus', count: 55}, 
//  {name: 'Weasel', description: 'Always weaseling around', count: 10}]

Lots of other stuff in there, too. Caching and forking and activating and copying across spreadsheets. You can see a lot of it in action in gs-distribution-manager, actually.

gs-distribution-manager

Since you can only have so many worksheets/cells per spreadsheet, sometimes you need to distribute your data across multiple spreadsheets. That's what gs-distribution-manager does.

Best use case I can think of so far is taking the input from a google form and generating worksheets out of it. You have a worksheet named template and DistributionManager copies it to where you want it, storing a bit of info about where it went.

gs-spreadsheet-manager's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.