Package: census-geocoder
(Unofficial) Python Binding for the US Census Geocoder APITheUS Census Geocoderis a Python library that provides Python bindings for theU.S. Census Geocoder API. It enables
you to use simple Python function calls to retrieve Python object representations of
geographic meta-data for the addresses or coordinates that you are searching for.WarningTheUS Census Geocoderis completely unofficial, and is in no way affiliated with
the US Government or the US Census Bureau. We strongly recommend that you do business
with them directly as needed, and simply provide this Python library as a facilitator
for your programmatic interactions with the excellent services provided by the US Census
Bureau.COMPLETE DOCUMENTATION:https://census_geocoder.readthedocs.org/en/latest.htmlContentsInstallationDependenciesWhy the Census Geocoder?Key US Census Geocoder FeaturesHello World and Basic Usage1. Import the Census Geocoder2. Execute a Coding RequestUsing a One-line AddressUsing a Parametrized AddressUsing Batched AddressesUsing Coordinates3. Work with the ResultsQuestions and IssuesContributingTestingLicenseInstallationTo install theUS Census Geocoder, just execute:$pipinstallcensus-geocoderDependenciesPython 3.x*Validator-Collection v1.5or higher*Backoff-Utils v.1.0or higher*Requests v.2.26or higherWhy the Census Geocoder?In fulfilling its constitutional and statutory obligations, the US Census Bureau provides
extensive data about the United States. They make this data available publicly through
their website, through their raw data files, and through their APIs. However, while their
public APIs provide great data, they are limited in both tooling and documentation. So to
help with that, we’ve created theUS Census Geocoderlibrary.TheCensus Geocoderlibrary is designed to provide a Pythonic interface for
interacting with the Census Bureau’sGeocoder API. It is specifically designed
to eliminate the scaffolding needed to query the API directly, and provides for simpler
and cleaner function calls to return forward geocoding and
reverse geocoding information. Furthermore, it exposes Python object
representations of the outputs returned by the API making it easy to work with the API’s
data in your applications.Key US Census Geocoder FeaturesEasy to adopt. Just install and import the library, and you can be
forward geocoding and reverse geocoding with just two lines of code.Extensive documentation. One of the main limitations of the Geocoder API is that its
documentation is scattered across the different datasets released by the Census Bureau,
making it hard to navigate and understand. We’ve tried to fix that.Location SearchUsing Geographic Coordinates (reverse geocoding)Using a One-line AddressUsing a Parametrized AddressUsing Batched AddressesGeography SearchUsing Geographic Coordinates (reverse geocoding)Using a One-line AddressUsing a Parametrized AddressUsing Batched AddressesSupports all available benchmarks, vintages, and layers.Simplified syntax for indicating benchmarks, vintages, and layers.No more hard to interpret field names. The library uses simplified (read: human
understandable) names for location and geography properties.Hello World and Basic Usage1. Import the Census Geocoderimportcensus_geocoderasgeocoder2. Execute a Coding RequestUsing a One-line Addresslocation=geocoder.location.from_address('4600 Silver Hill Rd, Washington, DC 20233')geography=geocoder.geography.from_address('4600 Silver Hill Rd, Washington, DC 20233')Using a Parametrized Addresslocation=geocoder.location.from_address(street_1='4600 Silver Hill Rd',city='Washington',state='DC',zip_code='20233')geography=geocoder.geography.from_address(street_1='4600 Silver Hill Rd',city='Washington',state='DC',zip_code='20233')Using Batched Addresses# Via a CSV Filelocation=geocoder.location.from_batch('my-batched-address-file.csv')geography=geocoder.geography.from_batch('my-batched-address-file.csv')Using Coordinateslocation=geocoder.location.from_coordinates(latitude=38.845985,longitude=-76.92744)geography=geocoder.geography.from_coordinates(latitude=38.845985,longitude=-76.92744)3. Work with the ResultsWork with Python Objectslocation.matched_addresses[0].address>>4600SILVERHILLRD,WASHINGTON,DC20233For detailed documentation, please see thecomplete documentationQuestions and IssuesYou can ask questions and report issues on the project’sGithub Issues PageContributingWe welcome contributions and pull requests! For more information, please see theContributor Guide.TestingWe useTravisCIfor our build automation andReadTheDocsfor our documentation.Detailed information about our test suite and how to run tests locally can be
found in ourTesting Reference.LicenseTheCensus Geocoderis made available under anMIT License.