Coder Social home page Coder Social logo

eladb / googledocsbackend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pyro2927/googledocsbackend

0.0 2.0 0.0 311 KB

Use a Google Docs Spreadsheet in a style similar to Parse

License: GNU General Public License v2.0

Objective-C 75.26% Ruby 24.74%

googledocsbackend's Introduction

GoogleDocsBackend

Use a Google Docs Spreadsheet in a style similar to Parse. You can setup a spreadsheet with all of the data you want, and pull that into your mobile application. An example spreadsheet can be seen here. The concept originated during the development on an app for Amp Music.

Screenshot

Version Platform

Setup

To allow a Google Spreadsheet to be accessed via this library (and API calls), you must Publish it. Note: Publishing and simply setting as public are two seperate things. See screenshots below The first row of cells acts as the keys for the objects fetched from the server, and each row after that is one object. Values for objects are paired with the keys in row 1. As such it is highly recommended that you name and protect row 1.

Publish

Start

In order to convert these into native NSObects, you need to subclass GDBModel, which makes use of Mantle. The important part is to implement + (NSDictionary *)JSONKeyPathsByPropertyKey in order to map the column headers to native attributes. See GDBExampleShowModel for a demonstration on how to do this.

Once you have that done, you can call [GoogleDocsServiceLayer objectsForWorksheetKey: sheetId: modelClass: callback:] in order to fetch the information from that spreadsheet and convert them into local native objects. See GDBExampleViewController's viewDidLoad for an example. Note: Google Docs appears to 1-index their spreadsheets instead of 0-index, so the first sheet in a worksheet would be index 1

Shortcomings

A service like Parse is far more powerful, this is purely an attempt to have a cheap and free alternative. Several things Parse can do that this can't at this time:

  • Allow client-side creation of objects
  • Support pointers/relationships

What it CAN do:

  • Support unlimited number of collaborators via sharing the document via Google Drive/Docs to other Google users
  • Be free for unlimited API requests

Right now this only works as a read-only, non-relational backend. If that works for you, hurray!

Usage

To run the example project; clone the repo, and run pod install from the Example directory first.

Installation

GoogleDocsBackend is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "GoogleDocsBackend", :git => "https://github.com/pyro2927/GoogleDocsBackend.git"

TODOs

  • Handle gaps in cells better
  • Parse header keys via nsregularexpressions
  • Clean up documentation
  • Enable writing of data
  • Handle BOOLs and NSDates more cleanly
  • Allow accessing of non-attributed values
  • Publish to CocoaPods

Author

pyro2927, [email protected]

License

GoogleDocsBackend is available under the GPLv2 license. See the LICENSE file for more info.

googledocsbackend's People

Contributors

eladb avatar pyro2927 avatar

Watchers

 avatar  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.