settings submodule

Module is containing all necessary global variables for the package.

Module also has the ability to read user-defined data from two paths:

  • $HOME/_SETTINGS_PATH
  • /etc/_SETTINGS_PATH

See _SETTINGS_PATH for details.

Note

If the first path is found, other is ignored.

Example of the configuration file ($HOME/edeposit/urnnbn.json):

{
    "EXPORT_DIR": "/somedir/somewhere"
}

Attributes

cz_urnnbn_api.settings.USERNAME = ''

Username for the URN – NBN resolver website

cz_urnnbn_api.settings.PASSWORD = ''

Password for the URN – NBN resolver website

cz_urnnbn_api.settings.REG_CODE = 'edep'

Registration code (used in API)

cz_urnnbn_api.settings.URL = 'https://resolver-test.nkp.cz/api/v3/'

URL of the URN – NBN resolver

cz_urnnbn_api.settings.REG_URL = 'https://resolver-test.nkp.cz/api/v3/registrars/'
cz_urnnbn_api.settings.get_all_constants()

Get list of all uppercase, non-private globals (doesn’t start with _).

Returns:Uppercase names defined in globals() (variables from this module).
Return type:list
cz_urnnbn_api.settings.substitute_globals(config_dict)

Set global variables to values defined in config_dict.

Parameters:config_dict (dict) – dictionary with data, which are used to set globals.

Note

config_dict have to be dictionary, or it is ignored. Also all variables, that are not already in globals, or are not types defined in _ALLOWED (str, int, float) or starts with _ are silently ignored.