All Projects → cchantep → foorgol

cchantep / foorgol

Licence: Apache-2.0 license
⛄ Google API client (or one the Discworld, the Ephebian God of Avalanches).

Programming Languages

scala
5932 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to foorgol

gspread-formatting
Complete cell formatting support for Google spreadsheets via gspread package.
Stars: ✭ 121 (+656.25%)
Mutual labels:  google-spreadsheet
OntoMaton
OntoMaton facilitates ontology search and tagging functionalities within Google Spreadsheets.
Stars: ✭ 35 (+118.75%)
Mutual labels:  google-spreadsheet
use-google-spreadsheet
react hook for using google spreadsheet as a data table (API endpoint)
Stars: ✭ 106 (+562.5%)
Mutual labels:  google-spreadsheet
ad localize
ADLocalize is a simple way to manage your localization files. Supported wording sources : CSVs and Google Sheets. Localization file generation available for iOS, Android, JSON (i18next), YAML and Java properties
Stars: ✭ 22 (+37.5%)
Mutual labels:  google-spreadsheet
Learn To Send Email Via Google Script Html No Server
📧 An Example of using an HTML form (e.g: "Contact Us" on a website) to send Email without a Backend Server (using a Google Script) perfect for static websites that need to collect data.
Stars: ✭ 2,718 (+16887.5%)
Mutual labels:  google-spreadsheet
Luckysheet
Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.
Stars: ✭ 9,772 (+60975%)
Mutual labels:  google-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 (+125%)
Mutual labels:  google-spreadsheet
google-spreadsheet-cli
📊 CLI for reading and writing data into Google Spreadsheet
Stars: ✭ 51 (+218.75%)
Mutual labels:  google-spreadsheet
budget-cli
Manage your Google budget spreadsheets from terminal.
Stars: ✭ 30 (+87.5%)
Mutual labels:  google-spreadsheet
node-sheets
read rows from google spreadsheet with google's sheets api
Stars: ✭ 16 (+0%)
Mutual labels:  google-spreadsheet
meteor-google-spreadsheets
Google Spreadsheets for Meteor
Stars: ✭ 53 (+231.25%)
Mutual labels:  google-spreadsheet
spreadsheet-to-json
Convert Google Spreadsheets to JSON using Javascript
Stars: ✭ 53 (+231.25%)
Mutual labels:  google-spreadsheet
gsheet to arb
Import translations (ARB/Dart) from Google Sheets
Stars: ✭ 21 (+31.25%)
Mutual labels:  google-spreadsheet
citybook
Create a resource directory from a contact spreadsheet.
Stars: ✭ 21 (+31.25%)
Mutual labels:  google-spreadsheet
php-google-spreadsheet-api
PHP library for read/write access to Google spreadsheets via the version 3 API.
Stars: ✭ 38 (+137.5%)
Mutual labels:  google-spreadsheet
import-products-from-gsheet-for-woo-importer
Import products from Google spreadsheet by standard woocommerce import.
Stars: ✭ 16 (+0%)
Mutual labels:  google-spreadsheet
google docs-ruby
A library which allows you to edit your spreadsheets with pleasure
Stars: ✭ 18 (+12.5%)
Mutual labels:  google-spreadsheet
GoogleAppsScripts
A repository for my google scripts (GS).
Stars: ✭ 50 (+212.5%)
Mutual labels:  google-spreadsheet

Foorgol

Google API client (or one the Discworld, the Ephebian God of Avalanches).

Build Status

Motivation

Google offer some nice Web API (Drive, Spreadsheet, ...), but Java client is not so nice to be easily integrated in a backend project (dependency issue, complexity).

Foorgol help integration of some of these features.

Usage

To include foorgol to your sbt project, add the following lines to your build.sbt:

resolvers += "Tatami Releases" at "https://raw.github.com/cchantep/tatami/master/releases/"

libraryDependencies += "foorgol" %% "scala" % "1.0.5-SNAPSHOT" // or "foorgol" % "java-client" % "1.0.5-SNAPSHOT"

Spreadsheet

Scala DSL for Google Spreadsheet can be initialized as following.

import foorgol.{ RefreshToken, Spreadsheet }

val api: Spreadsheet = Spreadsheet("accessToken")
// Given access token must not be expired, as there refresh token is 
// not provided along, so it can be refreshed automatically.

val refreshableApi: Spreadsheet = Spreadsheet("maybeExpiredAccessToken",
  Some(RefreshToken("clientId", "clientSecret", "refreshToken")))
// If access token is expired, then if will be automatically refreshed

Once access to Google Spreadsheet is initialized, following features can be used.

List all available spreadsheets

import scala.concurrent.Future
import foorgol.SpreadsheetInfo

// api: foorgol.Spreadsheet

val spreadsheets: Future[List[SpreadsheetInfo]] = api.list

Find a single spreadsheet by ID

import scala.concurrent.Future
import foorgol.SpreadsheetInfo

// api: foorgol.Spreadsheet

val spreadsheet: Future[SpreadsheetInfo] = api.spreadsheet("anID")

Create worksheet

import scala.concurrent.Future

// api: foorgol.Spreadsheet

val id: Future[String] = api.createWorksheet(spreadsheetId, "Work title")

List worksheets by spreadsheet ID

import scala.concurrent.Future
import foorgol.WorksheetInfo

// api: foorgol.Spreadsheet

val worksheets: Future[List[WorksheetInfo]] = api.worksheets(spreadsheetId)

List worksheets by URI

import scala.concurrent.Future
import foorgol.WorksheetInfo

// api: foorgol.Spreadsheet
// sheet: foorgol.SpreadsheetInfo

val worksheets: Future[List[WorksheetInfo]] = 
  api.worksheets(sheet.worksheetsUri)

Find a single worksheet by spreadsheet ID and worksheet index

import scala.concurrent.Future
import foorgol.WorksheetInfo

// api: foorgol.Spreadsheet
val firstWorksheet: Future[Option[WorksheetInfo]] = 
  api.worksheet("spreadsheetId", 0)

Find a single worksheet by spreadsheet ID and worksheet ID

import scala.concurrent.Future
import foorgol.WorksheetInfo

// api: foorgol.Spreadsheet
val worksheet: Future[Option[WorksheetInfo]] = 
  api.worksheet("spreadsheetId", "worksheetId")

Custom process with worksheets of a specified spreadsheet

import scala.concurrent.Future
import foorgol.WorksheetInfo

// api: foorgol.Spreadsheet

// Find worksheet with matching title
val matching: Future[Option[WorksheetInfo]] =
  api.worksheet("spreadsheetId")(None: Option[WorksheetInfo]) { 
    case (_, w @ WorksheetInfo(_, _, "Matching title", _, _)) => Left(Some(w)) 
      // found some matching sheet, put it at final value in the `Left`
    case (st, _) => Right(st)
      // Not matching title so will look at other worksheets
  }

Read cells by spreadsheet ID and worksheet index

import scala.concurrent.Future
import foorgol.WorksheetCells

// api: foorgol.Spreadsheet

val cells: Future[Option[WorksheetCells]] = 
  api.cells("spreadsheetId", 0, None, None)
// All cells of first worksheet from specified spreadsheet

Read cells by spreadsheet ID and worksheet ID

import scala.concurrent.Future
import foorgol.WorksheetCells

// api: foorgol.Spreadsheet

val cells: Future[Option[WorksheetCells]] = 
  api.cells("spreadsheetId", "worksheetId", None, None)
// All cells of specified worksheet

Read cells by URI

import scala.concurrent.Future
import foorgol.WorksheetCells

// api: foorgol.Spreadsheet
// work: foorgol.WorksheetInfo

val cells: Future[Option[WorksheetCells]] = api.cells(work.cellsUri, None, None)

Get last row by spreadsheet ID and worksheet ID

import scala.concurrent.Future
import foorgol.WorksheetCells

// api: foorgol.Spreadsheet

val last: Future[Option[WorksheetCells]] = 
  api.lastRow("spreadsheetId", "worksheetId")

Changing cells content by URI

import scala.concurrent.Future

// api: foorgol.Spreadsheet
// work: foorgol.WorksheetInfo

// Will change content for cells (4, 1) and (4, 3)
val versionUris: Future[List[String]] = api.change(work.cellsUri, 
  List(CellValue(4, 1, "4_1"), CellValue(4, 3, "4_3")))
// These urls can be used for batch update

Changing cells by spreadsheet ID and worksheet index

import scala.concurrent.Future

// api: foorgol.Spreadsheet

// Will change content for cells (1, 1) and (1, 2),
// in second worksheet of specified spreadsheet.
val versionUris: Future[List[String]] = api.change("spreadsheetId", 1, 
  List(CellValue(1, 1, "1_1"), CellValue(1, 2, "1_2")))

Changing cells by spreadsheet ID and worksheet ID

import scala.concurrent.Future

// api: foorgol.Spreadsheet

// Will change content for cells (1, 1) and (1, 2),
// in specified worksheet of specified spreadsheet.
val versionUris: Future[List[String]] = 
  api.change("spreadsheetId", "worksheetId", 
    List(CellValue(1, 1, "1_1"), CellValue(1, 2, "1_2")))

Append cells at end of specified worksheet

import scala.concurrent.Future

// api: foorgol.Spreadsheet

// Append a row with first cell "A" and third one "C"
val versionUris: Future[List[String]] = 
  api.append("spreadsheetId", "worksheetId", List(
    1 -> "A", 3 -> "C"))

Append row at end of specified worksheet

import scala.concurrent.Future

// api: foorgol.Spreadsheet

// Append a row with contiguous cells ("A", "B", "C")
val versionUris: Future[List[String]] = 
  api.append("spreadsheetId", "worksheetId", "A", "B", "C")

Given values are assumed to be contiguous. Other .append(spreadsheetId: String, worksheetId: String, values: List[(Int, String)]) must be prefered.

Requirements

  • Java 1.6+
  • SBT 1.1+

Build

Foorgol can be built from these sources using SBT (1.1+): sbt publish

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