The R package tidygeocoder
provides a friendly interface to the US Census Bureau Public Geocoder API.
This repository contains helper scripts (rscripts/geocode.r
) that help with batch processing of large datasets using functions from the tidygeocoder
package.
The Python package usps-api
provides a friendly interface to the US Postal Service Web Tools API. This API includes an address validation service that can be used to clean small numbers of addresses.
This repository contains helper scripts (geocodetoools/address_validator.py
) that help with processing of addresses requiring validation.
This repository also contains Python wrappers to tidygeocoder
scripts using the rpy2
library for running R embedded in a Python process.
These wrappers allow the address validation and geocoding workflows to be unified in Python; for example, through the creation of a single Jupyer notebook or Python script that performs both the R-native and Python-native tasks.
git clone https://github.com/kellypierce/geocode-tools.git
- packages listed in
renv.lock
- packages listed in
requirements.txt
- install locally using the provided
setup.py
script (e.g.pip3 install .
from within the repository directory)
The Python scrips in this repository are designed to use the python-dotenv
library to store and retrieve credentials saved as environment variables in a .env
file.
- Register for API credentials at https://www.usps.com/business/web-tools-apis/
- Create a
.env
file in the repository directory and assign the variablesUSPS_API_UID
andUSPS_API_PWD
the values of your user ID and password, respectively.