sherlock.imports._base_importer module

The base importer for sherlock catalogue imports


David Young

- document this module
class _base_importer(log, settings=False, pathToDataFile=False, version=False, catalogueName='', coordinateList=[], radiusArcsec=False)[source]

Bases: object

The base importer object used to import new catalgues into sherlock-catalogues database

Key Arguments

  • log – logger

  • settings – the settings dictionary

  • pathToDataFIle – path to the file containing the data to import

  • version – version number of the catalogue to be imported (e.g. DR12)

  • catalogueName – name of the catalogue to be imported

  • coordinateList – list of coordinates (needed for some streamed tables)

  • radiusArcsec – the radius in arcsec with which to perform the initial NED conesearch. Default False


To use this base class to write a new importer, create your class like so:

class newImporter(_base_importer):
add_data_to_database_table(dictList, createStatement=False)[source]

Import data in the list of dictionaries in the requested database table

Also adds HTMIDs and updates the sherlock-catalogue database helper table with the time-stamp of when the imported catlogue was last updated

Key Arguments

  • dictList - a list of dictionaries containing all the rows in the catalogue to be imported

  • createStatement - the table’s mysql create statement (used to generate table if it does not yet exist in database). Default False


- Write a checklist for creating a new sherlock database importer

Add HTMIDs to database table once all the data has been imported (HTM Levels 10,13,16)



Update the sherlock catalogues database helper table with the time-stamp of when this catlogue was last updated