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 returnsNone.- Returns:
intorNone– Parsed year for ordinance (int) orNoneif it wasn’t found in the document’s attrs.