In reference to issue #17, according to the Code Officiel Géographique (COG) a reference document published by l’Institut national de la statistique et des études économiques (Insee) which brings the codifications of a series of Insee codes, constituting some of the geographical codes of France.
Typically each year, these codes/data change over time. As a result, certain values may be valid in the COG for 2023 but become invalid in the COG for 2024 for example.
The purpose of this PR is to validate a given value against a specified given COG, representing the year of the Code Officiel Géographique's publication (In this case we have juste the reference data of 2023 and 2024) .
canton, commune, département, numéro département, pays, région
code commune insee, code pays, code région
Other thoughts
Despite a great overlap between code_commune sets for 2023, and 2024, the two sets have been defined separately by now. In the future, and with the extension to new vintages (Millésimes), there will be a need to optimize the memory usage.
There is a need to find a reliable data source for lower-case country (pays) lists for each COG, as the official list seems to be all uppercase.
Postal codes are not covered by Insee's COG but by La Poste (see open data page). No change has been done on this yet.
Context
In reference to issue #17, according to the Code Officiel Géographique (COG) a reference document published by l’Institut national de la statistique et des études économiques (Insee) which brings the codifications of a series of Insee codes, constituting some of the geographical codes of France.
Typically each year, these codes/data change over time. As a result, certain values may be valid in the COG for 2023 but become invalid in the COG for 2024 for example.
The purpose of this PR is to validate a given value against a specified given COG, representing the year of the Code Officiel Géographique's publication (In this case we have juste the reference data of 2023 and 2024) .
Example:
Pays(Millesime.A2023).is_valid("Mayotte")
Refactoring
Other thoughts