The registry Module
A utility to create skeleton data model (database schema) for gridMET data
- class Registry(destination: str, dn: Optional[str] = None)[source]
This class creates YAML data model for gridMET tables.
- COMMON_COLUMNS = '\n - year: \n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (EXTRACT (YEAR FROM observation_date)) STORED"\n type: INT\n index: true\n doc: The year of the observation\n - month: \n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (EXTRACT (MONTH FROM observation_date)) STORED"\n type: INT\n index: true\n doc: The year of the observation\n - day_of_the_year: \n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (EXTRACT (DOY FROM observation_date)) STORED"\n type: INT\n index: true\n doc: The year of the observation\n '
- COUNTY_COLUMNS = '\n - fips5:\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (county::INT) STORED"\n type: INT\n doc: County FIPS code as an integer, value is equal to "county".\n - fips2:\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (substring(county, 1, 2)::INT) STORED"\n type: INT\n doc: FIPS code of the US State in which the county is located\n - fips3:\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (substring(county, 3, 3)::INT) STORED"\n type: INT\n doc: FIPS code of the county without state FIPS code\n - state:\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (public.fips2state(substring(county, 1, 2)::VARCHAR)) STORED"\n - state_iso:\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (public.fips2state_iso(substring(county, 1, 2))) STORED"\n '
- ZCTA_COLUMNS = '\n - state:\n index: true\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (public.zip_to_state((EXTRACT (YEAR FROM observation_date))::INT, zcta::INT)) STORED"\n doc: |\n This column is for informational purposes only. The US State or \n territory Id associated with this ZCTA. Some ZCTAs span over\n more than one states or territories.\n - city:\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (public.zip_to_city((EXTRACT (YEAR FROM observation_date))::INT, zcta::INT)) STORED"\n doc: |\n This column is for informational purposes only. The name \n of the city preferred by the US Postal service for the ZIP code\n associated with this ZCTA.\n - county:\n source:\n type: "generated"\n code: "GENERATED ALWAYS AS (public.zip_to_fips5((EXTRACT (YEAR FROM observation_date))::INT, zcta::INT)) STORED"\n doc: |\n This column is for informational purposes only. The US County \n FIPS code, for the county having the largest intersection \n in terms of population with this ZCTA. \n '