Skip to content
forked from GrandyB/SheetsIO

Small configurable Java app that pulls data from a Google Spreadsheet (using v4 api) and writes to files and a local webserver.

License

Notifications You must be signed in to change notification settings

Manudoma/SheetsIO

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SheetsIO

license: GPL v3 GitHub release

Image of SheetsIO

Brief: Use Google Sheets as a central and easily updateable backend for all text/images/files in productions.

More:

A common issue as a producer is having an unruly mass of raw data - caster names/socials/photos, team names/logos/scores, player names/stats etc - without any tools it's a nightmare to setup and maintain. SheetsIO, with some basic config to map cell references to file names, allows you to bring down text, images and even webms from the web onto your local file system, and thus easily into your OBS productions using regular ol' OBS sources... all from the comfort of a Google Sheet!

There's other tools/methods out there that attempt to address this problem - Microsoft Excel (and other spreadsheet programs) often have the capability to record macros and save data to files, however this requires some technical knowledge to create, and requires the right type of spreadsheet program to use (as MS/Libre/Openoffice each their own language for writing macros, often making it difficult to share). Then there's project(s) such as RewindRL's updater system, which brings Google Sheets data into browser-based graphics, which while powerful, requires a fair bit of coding knowledge to use properly. SheetsIO on the other hand requires zero coding knowledge to implement, uses shareable configs, can bring in an unlimited amount of data of various types, allows for remote editing of data on Google Sheets, and is generally very simple to use.

Here's a full video on first-time setup and an advanced use-case (timestamps in video description): SheetsIO Intro Video Thumbnail

Want to help make this tool as useful as it could be? Try it out - break it! Write up all your bug reports and feature requests in the issues tab.

Getting started

  1. Get your API key from Google and enable it
  2. Create your Google Spreadsheet and enable "anyone with the link can view", grab its spreadsheet ID
  3. Setup your config with your spreadsheet ID/workbook name and cell/file references
  4. Load up the app, put your API key, choose your config and either hit 'update now' or tick 'autoupdate'

Any issues, refer to the troubleshooting wiki page.

Google Sheets API key

SheetsIO uses the Google Sheets v4 API; unlike previous version of the API, this one requires the use of an API key that you have to generate using Google's developer console. To do this, you can either create a project and then enable the Google Sheets API on that project or search for the API and enable it (which will automatically create you a project).

  1. Go to https://console.developers.google.com/
  2. Create a new project; this can be done in multiple ways but here's one:
    1. In the upper left 'Select a project' drop down, open it up and use 'New Project'
    2. Give it a name (SheetsIO-integration ?) and create it (this may take a moment)
  3. In the top-middle search bar, search for 'Google Sheets API', navigate to that and press the 'Enable' button, then go back to your project
  4. Navigate through 'Credentials' in the left-side menu, click 'Create Credentials' at the top and choose 'API key'

It should now display an API key for you to then use in your application! It's important to keep this secure, so whenever sharing configs, ensure you remove your apiKey. It is advised (although completely optional) to then 'restrict' that key by IP address, or at least specifically to the sheets API - can do that through the key's settings easily at any time.

Config

Configs are json files and can be placed anywhere, selected through the file chooser in the UI.

{
	"projectName": "myProject",
	"worksheetName": "Sheet1",
	"spreadsheetId": "12YrqfVJENT6FJZB5NZrv2fHKg36XEy2jTE5X-mwC61g",
	"cells": [
		{ "cell": "B2", "name": "team1Name" },
		{ "cell": "B3", "name": "team1Logo", "fileExtension": "png" },
		{ "cell": "B4", "name": "team2Name" },
		{ "cell": "B5", "name": "team2Logo", "fileExtension": "png" },
		{ "cell": "B6", "name": "marqueeText", "pad": "15" }
	]
}
  • "projectName" - becomes the folder name; files are generated within /files/projectName
  • "worksheetName" - sheets API only allows a single 'tab' within your worksheet to read, so this is the name of that tab in the lower bar
  • "spreadsheetId" - from part of the URL you use to access your spreadsheet - see below
  • "cells" - the configuration of cells to files - see below

spreadsheetId

For a sheet with the following URL: https://docs.google.com/spreadsheets/d/12YrqfVJENT6FJZB5NZrv2fHKg36XEy2jTE5X-mwC61g/edit#gid=0

The 'id' is that middle section: 12YrqfVJENT6FJZB5NZrv2fHKg36XEy2jTE5X-mwC61g

Remember that the spreadsheet's sharing settings must be open so that 'anyone with the link can view' in order for the system to connect.

cells

Each cell is formed of:

  • "cell" - the alphanumeric excel-style cell reference, e.g. "A4"
  • "name" - what this cell represents - also used as the first part of the file name, e.g. "team1Name"
  • "fileExtension" [optional] - the file extension, which in turn becomes the file type. System assumes the cell is "txt" if not optionally given
  • "pad" [optional] - if using a 'Text' type, this number of spaces will be added to end of your text. e.g. "15" will add 15 spaces to the end - useful for marquee-type text you wish to use in conjunction with the 'scroll' filter in OBS

Valid fileExtension values:

  • Images: "png", "jpg", "gif"
  • Text: "txt"

Timer

The timer is a combination of spinners and buttons to control /files/timer.txt, which updates each second that the timer is active.

  • Start button begins the countdown, regardless of values
  • Update button forces the countdown to the values in the box; if the timer is running, it'll then continue ticking down but from the new value, if the timer is paused, it'll set this new value but not resume automatically
  • Reset button forces the countdown to its starting 00:00 display but does not affect the spinners

Issues?

Head on over to the troubleshooting wiki page.

About

Small configurable Java app that pulls data from a Google Spreadsheet (using v4 api) and writes to files and a local webserver.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.8%
  • Other 0.2%