Exports data from google sheets to json format
Sheet to json exporter with a built-in parser with its own readable syntax for defining data types.
>
is used to define a range
1 > 2
will translate to{ "min" : 1, "max" : 2 }
in json
[
and ]
are used to define arrays of any type
[1, 2, 3]
will translate to[1, 2, 3]
in json[one, two, three]
will translate to["one", "two", "three"]
in json
(
and )
are used to define a key value pair of any type
(1, 2)
will translate to{ "key" : 1, "value" : 2 }
in json(1, one)
will translate to{ "key": 1, "value": "one" }
in json{1, one}
will translate to[{ "key": 1, "value": "one" }]
in json{1, one} {2, two}
will translate to[{ "key": 1, "value": "one" }, { "key": 2, "value": "two" }]
in json
#comment
columns will be ignored by the parser
For more complex examples and real usage see at the bottom
nuget restore GoogleSheet2Json.sln
or use the IDE for getting the required google packages for the solution.RELEASE
mode if you don’t want to get tons of logs from the parser.Get the client_secret.json
by following this guide.
Put the client_secret.json
in the same directory of the application.
The application requires some simple configurations, some of them are set in a json file. with the following required fields.
applicationName
can be GoogleSheet2Json
userName
spreadSheetId
you can get it from the sheet url
clientSecret
relative path to the client secret from the application
outputDirectory
Other configurations are passed as command line arguments:
-configPath=Path/To/The/Config/File
-sheetTab=TAB_NAME_IN_SHEET
-keyRange=RANGE
RANGE is something like A1:K, read google’s guide for accessing keys
-valueRange=RANGE
RANGE is something like A2:K, read google’s guide for accessing values
-outputDir=OTHER/DIR/
if you want to set a different output directory from the one defined in the config file
-outputFileName=SOME_NAME.extension
will throw a warning if not set
-isSingleObject
can export single object defined as key value pairs, see example below
-isLiteral=key_1,key_2,key_n
data can be exported as it is, without being lexed, see example below