sherlock.imports._base_importer module ∞
The base importer for sherlock catalogue imports
- Author
David Young
- document this module
-
class
_base_importer(log, settings=False, pathToDataFile=False, version=False, catalogueName='', coordinateList=[], radiusArcsec=False)[source] ∞ Bases:
objectThe base importer object used to import new catalgues into sherlock-catalogues database
Key Arguments
log– loggersettings– the settings dictionarypathToDataFIle– path to the file containing the data to importversion– version number of the catalogue to be imported (e.g. DR12)catalogueName– name of the catalogue to be importedcoordinateList– list of coordinates (needed for some streamed tables)radiusArcsec– the radius in arcsec with which to perform the initial NED conesearch. Default False
Usage
To use this base class to write a new importer, create your class like so:
```python 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 importedcreateStatement- the table’s mysql create statement (used to generate table if it does not yet exist in database). Default False
Usage
self.add_data_to_database_table( dictList=dictList, createStatement=createStatement )
- Write a checklist for creating a new sherlock database importer