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

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.2a0.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.2a0-py3-none-any.whl (17.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geosub-0.1.2a0.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.2a0.tar.gz
Algorithm Hash digest
SHA256 40aeb1da7ac24917dfc38272353c231e4b7d1deed865288aed7ed43ac9b04350
MD5 a08b79d81edf211518d6c18b545c1bdf
BLAKE2b-256 9a3bb12ef05d050586541a261cb5fab5a4cb43d8cb97208f5cd415008ed0d4da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geosub-0.1.2a0-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.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc4aa9c8238df07423330dc91d123c45029dcdc36212118d56b85aa4594fc1f1
MD5 0d9e63791902927f2086887125667b4c
BLAKE2b-256 2d96f91e8d59b41ddf2d561252934f7ad2df00acec0f1b37b24851017089b40f

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