azure-geocode-mapping is a Python package that generates a mapping of Azure regions to their display names and geocodes.
To install azure-geocode-mapping, you can use Poetry by running:
poetry installFirst off, we need the input files to be created in the data directory:
./data.shYou can generate the mapping by running the following command:
poetry run azure-geocode-mapping
# or
poetry run python -m geomapper.mappingThis will create a JSON file data/geo.mapping.json that contains the Azure region mapping.
You can also import the create_azure_mapping function from the geomapper.mapping module and use it in your own code:
from geomapper.mapping import create_azure_mapping
mapping = create_azure_mapping()This package uses two data files to generate the mapping:
data/azure-regions.json: a JSON file containing the list of Azure regions and their aliases.data/azure-geocodes.xml: an XML file containing the list of Azure regions and their geocodes.
These files are generated by data.sh into the data/ directory. Examples of their structure is also mimicked in the files from test/data.
This package comes with a set of unit tests that can be run using pytest. To run the tests, install the dev dependencies by running:
poetry install --with testThen, run the tests using:
pytest tests/Contributions are welcome! Please see CONTRIBUTING.md for more information.
azure-geocode-mapping is distributed under the MIT License. See the LICENSE file for more information.