Skip to content

smart_trap_update_metadata.py

Connor Howington edited this page Sep 5, 2018 · 1 revision

Description

This script creates and modifies the metadata file smart-trap-metadata.json so that it is up-to-date with any number of API keys and traps associated with them. Before smart_trap_json_parser.py is run, this script must be run if there's a new API key or new traps.

The script provides three separate subcommands:

  • add-key adds an API key to the database along with given information about who owns the account associated with this API key and the prefix to use for the event and occurrence IDs that will be created in smart_trap_json_parser.py.
  • change-key changes the API key associated with a certain trapset.
  • update-traps takes a JSON file containing trap data produced by smart_trap_download_date.py and adds any new traps to the given API key.

Any potential conflicts are checked, such as if a new API key already exists or if a new trap already exists under a different API key.

Clone this wiki locally