gbif_registrar.configure

Configure the gbif_registrar package for use.

Module Contents

Functions

load_configuration(configuration_file)

Loads the configuration file as global environment variables for use

unload_configuration()

Removes global environment variables set by the load_configuration

initialize_configuration_file(file_path)

Returns a template configuration file to path.

gbif_registrar.configure.load_configuration(configuration_file)

Loads the configuration file as global environment variables for use by the gbif_registrar functions.

Remove these environment variables with the unload_configuration function.

Parameters:

configuration_file (str) – Path of the configuration file.

Return type:

None

Notes

Create a template configuration file with the initialize_configuration_file function.

Examples

>>> load_configuration("configuration.json")
gbif_registrar.configure.unload_configuration()

Removes global environment variables set by the load_configuration function.

Return type:

None

Examples

>>> unload_configuration()
gbif_registrar.configure.initialize_configuration_file(file_path)

Returns a template configuration file to path.

The template configuration contains all the parameters a user needs to set up the gbif_registrar package for use.

Parameters:

file_path (str) – Path to which the configuration file will be written.

Returns:

Writes the template configuration file to disk as a .json file.

Return type:

None

Notes

The configuration file is a .json file with the following keys:
USER_NAMEstr

The username for the GBIF account.

PASSWORDstr

The password for the GBIF account.

ORGANIZATIONstr

The organization key for the GBIF account.

INSTALLATIONstr

The installation key for the GBIF account.

GBIF_APIstr

The GBIF API endpoint.

REGISTRY_BASE_URLstr

The GBIF registry base URL.

GBIF_DATASET_BASE_URLstr

The GBIF dataset base URL.

PASTA_ENVIRONMENTstr

The PASTA environment base URL.

Examples

>>> initialize_configuration_file("configuration.json")