canonical_database_name()#

function canonical_database_name(database)#

Resolve a database name to the spelling it is registered under.

The names are compared without regard to letter case, so 'APMIFWSI001_dr2' is 'apmifwsi001_DR2' and 'WSI01' is 'wsi01'. The registered spelling is the name of the CasJobs context and of the ORM attribute of the database.

Parameters:

database (str) – A public database (see PUBLIC_DATABASES) or a private wsiXX database (see WSI_DATABASES).

Returns:

The registered name of the database.

Raises:

DatabaseNotValidError – database is in neither registry.

Return type:

str