Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
*~
*.iml
.idea
build/
/classpath/
/.gradle
/pkg/
*.gemspec
/tmp/
/.bundle/
/Gemfile.lock
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jruby-9.1.13.0
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org/'
gemspec
Empty file modified LICENSE.txt
100755 → 100644
Empty file.
64 changes: 43 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,66 @@
# Google Spreadsheets output plugin for Embulk [![Build Status](https://travis-ci.org/kataring/embulk-output-google_spreadsheets.svg?branch=master)](https://travis-ci.org/kataring/embulk-output-google_spreadsheets) [![Gem Version](https://badge.fury.io/rb/embulk-output-google_spreadsheets.svg)](http://badge.fury.io/rb/embulk-output-google_spreadsheets)

Embulk output plugin to load into Google Spreadsheets.
# Google Spreadsheets output plugin for Embulk

## Overview

* **Plugin type**: output
* **Load all or nothing**: no
* **Resume supported**: no
* **Cleanup supported**: yes
* **Cleanup supported**: no

## Usage
## Configuration

### Install plugin
- auth_method (string, default: 'authorized_user'): 'authorized_user' or 'service_account'
- json_keyfile (string, required): credential file path or `content` string
- spreadsheets_url (string, required): your spreadsheet's url
- worksheet_title (string, required): worksheet's title
- mode (string, default: append): writing record method, available mode are `append` and `replace`
- header_line (bool, default: false): if true, write header to first record
- start_row (integer, default: 1): specific the start row
- start_column (integer, default: 1): specific the start column
- null_string (string, default: ''): replace null to `null_string`
- default_timezone (string, default: '+00:00'): time zone offset of timestamp columns
- default_timestamp_format (string, default: '%Y-%m-%d %H:%M:%S.%6N %z'): output format of timestamp columns

```
embulk gem install embulk-output-google_spreadsheets
```
**json_keyfile**

specific the credential file which the Google Developer Console provides for authorization.
https://console.developers.google.com/apis/credentials
if use oauth, should be included the `refresh_token` field in credential json file.

## Configuration

- **service_account_email**: Your Google service account email (string, required)
- **p12_keyfile**: Fullpath of private key in P12(PKCS12) format (string, required)
- **spreadsheet_id**: Your spreadsheet id (string, required)
- **sheet_index**: sheet index (int, optional default: 0)
- **application_name**: Anything you like (string, optional defaulf: "Embulk-GoogleSpreadsheets-OutputPlugin")
```
{
"client_id": "******************************************************",
"client_secret": "***************************",
"refresh_token": "***************************"
}
```

## Example

```yaml
```
out:
type: google_spreadsheets
service_account_email: 'XXXXXXXXXXXXXXXXXXXXXXXX@developer.gserviceaccount.com'
p12_keyfile: '/tmp/embulk.p12'
spreadsheet_id: '1RPXaB85DXM7sGlpFYIcpoD2GWFpktgh0jBHlF4m1a0A'
json_keyfile:
content: |
{
"client_id": "******************************************************",
"client_secret": "***************************",
"refresh_token": "***************************"
}
# json_keyfile: './keyfile.json'
spreadsheets_url: 'https://docs.google.com/spreadsheets/d/16RSM_xj5ZB4rz0WBlnIbD1KHO46KASnAY04e_oYUSEE/edit'
worksheet_title: 'シート1'
start_row: 1
start_column: 1
header_line: true
null_string : '(NULL)'
default_timezone: '+09:00'
default_timestamp_format: "%Y-%m-%d %H:%M:%S %z"
```


## Build

```
$ ./gradlew gem
$ rake
```
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require "bundler/gem_tasks"

task default: :build
76 changes: 0 additions & 76 deletions build.gradle

This file was deleted.

20 changes: 20 additions & 0 deletions embulk-output-google_spreadsheets.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Gem::Specification.new do |spec|
spec.name = "embulk-output-google_spreadsheets"
spec.version = "0.1.0"
spec.authors = ["potato2003"]
spec.summary = "Google Spreadsheets output plugin for Embulk"
spec.description = "Dumps records to Google Spreadsheets."
spec.email = ["potato2003@gmail.com"]
spec.licenses = ["MIT"]
# TODO set this: spec.homepage = "https://github.com/ryuji.ito/embulk-output-google_spreadsheets"

spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
spec.test_files = spec.files.grep(%r{^(test|spec)/})
spec.require_paths = ["lib"]

#spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
spec.add_development_dependency 'embulk', ['>= 0.8.35']
spec.add_development_dependency 'bundler', ['>= 1.10.6']
spec.add_development_dependency 'rake', ['>= 10.0']
spec.add_dependency 'google-api-client'
end
Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 0 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties

This file was deleted.

164 changes: 0 additions & 164 deletions gradlew

This file was deleted.

Loading