.. py:currentmodule:: astropathdb.db_io.dbconnect :py:func:`.canonical_database_name` ============================================= .. py:function:: canonical_database_name(database) :single-line-parameter-list: 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. :param database: A public database (see :attr:`~.APDBWSICONST.PUBLIC_DATABASES`) or a private ``wsiXX`` database (see :attr:`~.APDBWSICONST.WSI_DATABASES`). :returns: The registered name of the database. :raises DatabaseNotValidError: ``database`` is in neither registry.