compass.utilities.finalize.doc_infos_to_db#
- doc_infos_to_db(doc_infos)[source]#
Aggregate parsed ordinance CSV files into a normalized database
- Parameters:
doc_infos (
Iterable) – Iterable of dictionaries describing ordinance extraction results. Each dictionary must contain"ord_db_fp"(path to a parsed CSV),"source"(document URL),"date"(tuple of year, month, day, withNoneallowed), and"jurisdiction"(aJurisdictioninstance).- Returns:
pandas.DataFrame– Consolidated ordinance dataset.int– Number of jurisdictions contributing at least one ordinance to the consolidated dataset.
Notes
Empty or
Noneentries indoc_infosare skipped. Ordinance CSVs that lack parsed values (num_ordinances_dataframeequals zero) are ignored. The returned DataFrame enforces an ordered column layout and casts thequantitativeflag to nullable boolean.