README.md 1.39 KB
Newer Older
Mark Campbell's avatar
Mark Campbell committed
1 2 3 4
# csv_to_gsheet

This is a command line utility that imports into a new Google Sheets document and then opens the resulting Google Sheet document in the user's browser via Mac OS X's `open http://foobar.com/` command.

Mark Campbell's avatar
Mark Campbell committed
5 6
## Install

7 8 9
```
gem install csv_to_gsheet
```
Mark Campbell's avatar
Mark Campbell committed
10

Mark Campbell's avatar
Mark Campbell committed
11 12
## Usage

13
First, you must download the `credentials.json` file from Google's website. Go to [here](https://developers.google.com/identity/sign-in/web/sign-in) and click on 'Configure A Project'. From there, you'll create an OAuth2 application owned by your own account.
Mark Campbell's avatar
Mark Campbell committed
14

15
That OAuth2 application will then ask for permission to have access to you personal Google Sheets account via a web link that will be shown to you on your first invocation of the `csv_to_gsheet` command.
Mark Campbell's avatar
Mark Campbell committed
16

17 18 19
Store the downloaded `credentials.json` file in `$HOME/.csv_to_gsheet_google_api_credentials.json`. After you invoke the program, another local file with a token authorizing the local csv_to_gsheet command to manipulate your Google Sheets spreadsheets will be created in `$HOME/.csv_to_gsheet_google_oauth2_token.yaml`.

Once you have your `credentials` file renamed to the correct file, run the command:
Mark Campbell's avatar
Mark Campbell committed
20

Mark Campbell's avatar
Mark Campbell committed
21
```
Mark Campbell's avatar
Mark Campbell committed
22
csv_to_gsheet my_file.csv
Mark Campbell's avatar
Mark Campbell committed
23
```
Mark Campbell's avatar
Mark Campbell committed
24

Mark Campbell's avatar
Mark Campbell committed
25
## Video of it working
26

Mark Campbell's avatar
Mark Campbell committed
27
[![](screencast_poster.png)](http://www.youtube.com/watch?v=vvOoG__E1gk "")
28 29 30 31

## License

csv_to_gsheet is licensed under LGPL v3.0 or later. If this doesn't work for you, reach out to me and we can work something out.