This PR proposes a script that should satisfy issue #6.
The script takes in account the following environmental variables:
OPENDATA_SOURCES_DIR: the folder that contains sources json files, defaults to "./sources"
OPENDATA_ORGANIZATIONS_DIR: the folder containing the organisations details, defaults to "./orgs"
OPENDATA_OUTPUT_FILENAME: the file where the data will be stored, should include the file extension, defaults to "./data.json"
OPENDATA_CAN_OVERRIDE: if True will allow OPENDATA_OUTPUT_FILENAME to be overwritten if exists; defaults to True
OPENDATA_KEEP_OWNER: sources contain an owner_org value that is used to link them to the related organisation. Since the data are merged, this information is redundant and may be removed in sources and kept only in the organisation to save some bytes. Defaults to False
OPENDATA_USE_STDOUT: outputs the data also to stdout. Default: False.
Exit codes (details on stderr):
0: everything ran smoothly, or just with a warning (sources folder may be empty or may not exist)
1: output file exists but can not be overwritten
2: organisations folder does not exist
This PR proposes a script that should satisfy issue #6. The script takes in account the following environmental variables:
"./sources"
"./orgs"
"./data.json"
True
will allow OPENDATA_OUTPUT_FILENAME to be overwritten if exists; defaults toTrue
owner_org
value that is used to link them to the related organisation. Since the data are merged, this information is redundant and may be removed in sources and kept only in the organisation to save some bytes. Defaults toFalse
False
.Exit codes (details on stderr):
0
: everything ran smoothly, or just with a warning (sources folder may be empty or may not exist)1
: output file exists but can not be overwritten2
: organisations folder does not exist