Skip to main content

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

Project description

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.1a0

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geosub-0.1.1a0.tar.gz (16.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geosub-0.1.1a0-py3-none-any.whl (17.1 MB view details)

Uploaded Python 3

File details

Details for the file geosub-0.1.1a0.tar.gz.

File metadata

  • Download URL: geosub-0.1.1a0.tar.gz
  • Upload date:
  • Size: 16.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for geosub-0.1.1a0.tar.gz
Algorithm Hash digest
SHA256 0272bfe4744800db111b4729992ad9db2896899e641abc3c6236b5352dbd1f91
MD5 9ea2478f24da6dd76fd477f73ba88309
BLAKE2b-256 0ea0be5278d71f9098b522704120344721298b7f9b1dec7ef870ff1a58d334ea

See more details on using hashes here.

File details

Details for the file geosub-0.1.1a0-py3-none-any.whl.

File metadata

  • Download URL: geosub-0.1.1a0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for geosub-0.1.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 33800a388efca57b7492c2e48399e85e3fc0f77607dbd40648dfe75b162820e9
MD5 459f2a403e5a3707a248a26aa6c036ef
BLAKE2b-256 c55ba014fb234d91f4cd32e465b950581d748bce62bdf600bf61a6ff71fb2325

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page