Update default local data with latest data from Publicdb

Update local JSON and TSV data

This script updates the local copies of the JSON and TSV data from the Public Database API. If internet is unavailable the api uses these files. The use of local data can also be forced to skip calls to the server or prevented to require fresh data from the server.

Not all available data is included by default because then the SAPPHiRE package would become to large. It is possible to add those files after installation.

This can be run by simply running the installed script from the command line:

$ update_local_data

To make the script show information about what it will do add the help flag:

$ update_local_data --help
sapphire.data.update_local_data.update_local_json(progress=True)

Get cluster organisation and basic station JSON data

sapphire.data.update_local_data.update_local_tsv(progress=True)

Get configuration and calibration TSV data for all stations

sapphire.data.update_local_data.update_toplevel_json(data_type)
sapphire.data.update_local_data.update_sublevel_json(arg_type, data_type, progress=True)
sapphire.data.update_local_data.update_sublevel_tsv(data_type, station_numbers, progress=True)
sapphire.data.update_local_data.update_subsublevel_tsv(data_type, station_numbers, network, progress=True)
sapphire.data.update_local_data.get_and_store_json(url)
sapphire.data.update_local_data.get_and_store_tsv(url)
sapphire.data.update_local_data.main()