Skip to content

Config file

Matthew Bourque edited this page Mar 14, 2022 · 7 revisions

In order to avoid hard coding commonly used data, or data that may be a security risk (such as filepaths, instrument configurations, etc.), the jwql application employs a configuration file to store such information. The jwql code expects this config file to be named config.json, and to be placed within the main directory in individual clones of the jwql repository. This can be achieved by the following:

  1. If you have not yet done so, install the jwql package. See the installation instructions for further details.
  2. Navigate to the jwql/jwql/ directory of where the package is installed.
  3. Retrieve a copy of the config.json file from this innerspace page and save it in this directory.

Since some of these data contain sensitive information, we do not provide the actual values here. Please ask a JWQL team member or email jwql@stsci.edu if you need assistance.

These data can be accessed in a jwql script via the utils.py module, for example:

from jwql.utils.utils import get_config
settings = get_config()
connection_string = settings['connection_string']

In this case, settings is a python dict containing the key/value pairs stored in the config.json file.