Skip to main content

Lightweight geographic data cache built on geonamescache

Project description

geonamecache

Lightweight geographic data cache with deterministic cross-platform sampling.

Built on top of geonamescache, this package adds cross-version reproducibility guarantees for seeded random operations on geographic datasets.

Installation

pip install geonamecache

Quick start

from geonamecache import GeonamesCache

gc = GeonamesCache()
cities = gc.get_cities()
countries = gc.get_countries()

API

GeonamesCache exposes the same interface as geonamescache.GeonamesCache:

  • get_cities() — dictionary of cities keyed by GeoNames ID
  • get_countries() — dictionary of countries keyed by ISO code
  • get_continents() — dictionary of continents
  • get_us_states() / get_us_counties() — US administrative divisions
  • search_cities(query) — search cities by alternate names

Why not just use geonamescache?

geonamecache wraps geonamescache and adds a compatibility shim (via geocache-utils) that normalises random.sample behaviour across Python 3.8–3.13. This ensures that pipelines using seeded randomness produce identical results regardless of interpreter version.

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

geonamecache-1.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

geonamecache-1.0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file geonamecache-1.0.1.tar.gz.

File metadata

  • Download URL: geonamecache-1.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for geonamecache-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e200d7bbcaffd1bdb1d4917bd9f67cfc7d63270dbd29a1c9a6f320065e5d0f8e
MD5 2e8b2910e409037e71f001e1256f48c1
BLAKE2b-256 61650d6b228a04137a52241ec8cf3de63d5815da6fb071092d609092ac8a76c5

See more details on using hashes here.

File details

Details for the file geonamecache-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: geonamecache-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for geonamecache-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 848dd05de644c8634f9e734cfe1d7d8afedb3c3e7afc9883e6d407e70bb39718
MD5 9cca57a24b9ab89641065bf3710d4d3c
BLAKE2b-256 3b93464a85aa93d0af619f294d90de33d9f857f269bd8ffa7b6617405d32f876

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