compass.utilities.parsing.extract_ord_year_from_doc_attrs#

extract_ord_year_from_doc_attrs(doc_attrs)[source]#

Extract year corresponding to the ordinance from doc instance

Parameters:

doc_attrs (dict) – Document meta information about the jurisdiction. Must have a “date” key in the attrs that is a tuple corresponding to the (year, month, day) of the ordinance to extract year successfully. If this key is missing, this function returns None.

Returns:

int or None – Parsed year for ordinance (int) or None if it wasn’t found in the document’s attrs.