utils module

astrodbkit2.utils.datetime_json_parser(json_dict)[source]

Function to convert JSON dictionary objects to datetime when possible. This is required to get datetime objects into the database. Adapted from: https://stackoverflow.com/questions/8793448/how-to-convert-to-a-python-datetime-object-with-json-loads

astrodbkit2.utils.deprecated_alias(**aliases)[source]

Decorator from StackOverflow https://stackoverflow.com/questions/49802412/how-to-implement-deprecation-in-python-with-argument-alias in order to handle deprecation of renamed columns To use: add @deprecated_alias(old_name=’new_name’)

astrodbkit2.utils.get_simbad_names(name, verbose=False)[source]

Get list of alternate names from Simbad

Parameters:
namestr

Name to resolve

verbosebool

Verbosity flag

Returns:
List of names
astrodbkit2.utils.json_serializer(obj)[source]

Function describing how things should be serialized in JSON. Datetime objects are saved with datetime.isoformat(), Parameter class objects use clean_dict() while all others use __dict__

astrodbkit2.utils.rename_kwargs(func_name, kwargs, aliases)[source]

Helper function used be deprecated_alias