Skip to main content

Whereabouts

Fast, scalable geocoding for Python using DuckDB. The geocoding algorithms are based on the following papers:

Description

Geocode addresses and reverse geocode coordinates directly from Python in your own environment.

  • No additional database setup required. Uses DuckDB to run all queries
  • No need to send data to an external geocoding API
  • Fast (Geocode 1000s / sec and reverse geocode 200,000s / sec)
  • Robust to typographical errors

Requirements

  • Python 3.8+
  • requirements.txt (found in repo)

Installation: via PIP

whereabouts can be installed either from this repo using pip / uv / conda

pip install whereabouts

1. Install depedencies

Install all the dependencies:

pip install -r requirements.txt

Download a geocoder database or create your own

You will need a geocoding database to match addresses against. You can either download a pre-built database or create your own using a dataset of high quality reference addresses for a given country, state or other geographic region.

1. Download a geocoder database

Pre-built geocoding database are available from Huggingface. The list of available databases can be found here

As an example, to install the small size geocoder database for all of Australia:

python -m whereabouts download au_all_sm

2. Create a geocoder database

You can create your own geocoder database if you have your own address file. This file should be a single csv or parquet file with the following columns:

Column name Description Data type
ADDRESS_DETAIL_PID Unique identifier for address int
ADDRESS_LABEL The full address str
ADDRESS_SITE_NAME Name of the site. This is usually null str
LOCALITY_NAME Name of the suburb or locality str
POSTCODE Postcode of address int
STATE State str
LATITUDE Latitude of geocoded address float
LONGITUDE Longitude of geocoded address float

These fields should be specified in a setup.yml file. Once the setup.yml is created and a reference dataset is available, the geocoding database can be created:

python -m whereabouts setup_geocoder setup.yml

Geocoding examples

Geocode a list of addresses

from whereabouts.Matcher import Matcher

matcher = Matcher(db_name='gnaf_au')
matcher.geocode(addresslist, how='standard')

For more accurate geocoding you can use trigram phrases rather than token phrases (note that the trigram option has to have been specified in the setup.yml file as part of the setup)

matcher.geocode(addresslist, how='trigram')

Metadata

Release files for whereabouts 0.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whereabouts 0.3.9
File Size Uploaded
whereabouts-0.3.9.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for whereabouts 0.3.9
File Interpreter ABI Platform
whereabouts-0.3.9-py3-none-any.whl Python 3 none any Details

Total release size: 52.5 kB

Release files / whereabouts-0.3.9.tar.gz

Download URL whereabouts-0.3.9.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e1c13c0956bb2a9d9e4608dfbf16519649a23d2555593a88a48237898218f5c3
BLAKE2b-256 checksum
How to use checksums
a769bdd1607958268be23c7513cff911439c5534d6fba93f7e8b51249a699d73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0

Release files / whereabouts-0.3.9-py3-none-any.whl

Download URL whereabouts-0.3.9-py3-none-any.whl
Size 33.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
779488b3e73a6356d2b59fbd51dfabec77db3637e23115df0e3d2bae77f522df
BLAKE2b-256 checksum
How to use checksums
8d46599233bcd5d71436b9f21210bcac7b1f8264e4a4332fdee9c78f70b4b857
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0

Release history Release notifications | RSS feed

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.20

2 release files

0.3.19

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.15

2 release files

0.3.13

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.10

2 release files

This release

0.3.9 This release

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page