GithubHelp home page GithubHelp logo

goodel's Introduction

Goodel

Google Apps Script is powerful. Similar to Microsoft's VBA, it programmatically queries Google services such a Drive, Forms, Analytics, and Mail with minimal setup.

Google Sheets works well as a database for these scripts*, but querying records by rows and columns is no fun. Goodel hides the querying under a familiar object-oriented API.

* If you're wondering, Google Apps Script has a service called JDBC that can connect to a cloud database. However you'll have to set up your SQL server or pay for Google Cloud SQL. Note that JDBC is just a driver, not an ORM.

Why use Goodel?

Do you often fight the urge to automate every repetitive task you come across? Do you sometimes wish you could replace all the spreadsheets in your life with custom web apps?

xkcd: the general problem

Google App Script narrows the gap between what a web app and what a spreadsheet can do. Goodel goes one step further and makes the two equally enjoyable. Perfect for rapid prototyping and automating administrative tasks.

Set up

From your Google scripts editor, click "Resources > Libraries", then enter MX4aQpaRvsS-JcZN6JrngxPZd3ZQaD1Xq (this project's key) in the search field and click "Select". Goodel will appear in your included libraries. Select the latest version from the corresponding dropdown menu and hit "Save". You're ready to go!

Note: Loading functions from external libraries seems not to work for some. This is a known issue as of December 2014. If the libraries' variables are undefined in your script, you can simply add the goodel.gs file to your project.

Usage

Given a sheet named "Logicians" and the table below starting at the origin A1:

A B C
1 firstName lastName country
2 David Hilbert Germany
3 George Boole Britain
4 Alfred Tarski Poland
5 Augustus De Morgan Britain
// "Students" is the name of a sheet in the active spreadsheet
var Logician = Goodel("Logicians");

var alf = Logician.findBy({ firstName: "Alfred", lastName: "Tarski" });
alf.country // => "Poland"
var brits = Logician.findWhere({ country: "Britain" });
brits.length // => 2

var al = new Logician({ firstName: "Alan", lastName: "Turing" });
al.save(); // "Logician.create(al)" also works.

Works with arbitrary numbers of rows and columns.

Contributing

  1. Fork it ( https://github.com/7imon7ays/goodel/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

goodel's People

Watchers

Tomasz Drobiszewski avatar James Cloos 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.