Skip to content
/ geosub Public

Lookup ISO 3166-2 geographic subdivisions from postal and country codes, using GeoNames and pycountry

License

Notifications You must be signed in to change notification settings

dmayo3/geosub

Repository files navigation

Github Actions Status https://codecov.io/github/dmayo3/geosub/graph/badge.svg?token=A0WO17S0KD Documentation Status PyPI Package Supported versions Code style: black Type checked by mypy License

geosub v0.1.2a0

Docs: https://geosub.readthedocs.io/

Lookup ISO 3166-2 geographic subdivisions from postal and country codes, using GeoNames and pycountry.

Adapted from a very similar library for looking up timezones: https://github.com/dmayo3/geotz

Motivation

  1. Easy to use. No API key or external API service required.
  2. Fast offline lookup.
  3. No downloads required; the necessary data comes bundled with the package.
  4. No network requests.
  5. I tried to keep the extra dependencies to a minimum. Only pycountry is required.
  6. Data is loaded from disk on demand, so as to not use unnecessary memory.

Development

To run the build, there's the GitHub actions workflows as well as the option to run locally.

For running the build locally, use pip install tox and the run tox in the repository base directory (or tox -p to run the build in parallel).

  1. Ensure you have tox installed e.g. by running pip install tox
  2. Extract data tox -e extract_data
  3. Run the build: tox

About

Lookup ISO 3166-2 geographic subdivisions from postal and country codes, using GeoNames and pycountry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages