Input Sources#

JSON can be retrieved from a variety of sources, locally and on the web. Below are examples of how to use the command line tool but they will also work with the Python Library.

Local File#

flatterer games.json games_dir

games.json can be a full or relative path to file.


Use - to get JSON from Stdin.

cat games.json | flatterer - games_dir


flatterer '' games_dir


See S3 for how to configure connection to S3.

flatterer 's3://bucketname/path/in/bucket' games_dir


If the file ends with .gz it is assumed to be a gzip compressed file. This will work with all input formats above.

flatterer 'games.json.gz' games_dir

Multiple inputs#

Multiple files can be selected. The last argument is the output directory and the rest are treated as inputs.

flatterer games.json games2.json games3.json games_dir

As long as the format of the input is the same in each file, you can get the JSON from various sources. For example, this gets new line delimited json files (ndjson) from stdin, a gziped local file, a gzipped file on s3 and a file on the web.

cat games.ndjson | flatterer --ndjson - games.ndjson.gz s3://bucketname/games.ndjson.gz games_dir