Skip to main content

Python package for address validations

Project description

Description

The addresshunt package gives you painless access to the addresshunt API’s. It performs requests against our API’s for

Requirements

addresshunt-py is tested against Python 3.6, 3.7, 3.8 and 3.9, and PyPy3.6 and PyPy3.7.

Installation

To install from PyPI, simply use pip:

pip install addresshunt

Usage

Examples

import addresshunt

autocomplete_address = "11 NICHOLSON STREET"
match_address = "NICHOLSON STREET"
forward_geocode_address = "MELBOURNE MUSEUM, 11 NICHOLSON STREET, CARLTON, VIC, 3053"
reverse_geocode_address_latitude = "-37.803165"
reverse_geocode_address_longitude = "144.971802"
split_address = "MELBOURNE MUSEUM, 11 NICHOLSON STREET, CARLTON, VIC, 3053"
timezone_address = "MELBOURNE MUSEUM, 11 NICHOLSON STREET, CARLTON, VIC, 3053"
validate_address = "MELBOURNE MUSEUM, 11 NICHOLSON STREET, CARLTON, VIC, 3053"

client = addresshunt.Client(api_key='') # Specify your personal API key

autocomplete = client.autocomplete(autocomplete_address)
print("autocomplete: \n" + str(autocomplete) + str('\n'))

match = client.match(match_address)
print("match: \n" + str(match) + str('\n'))

forward_geocode = client.forward_geocode(forward_geocode_address)
print("forward_geocode: \n" + str(forward_geocode) + str('\n'))

reverse_geocode = client.reverse_geocode(reverse_geocode_address_latitude, reverse_geocode_address_longitude)
print("reverse_geocode: \n" + str(reverse_geocode) + str('\n'))

split = client.split(split_address)
print("split: \n" + str(split) + str('\n'))

timezone = client.timezone(timezone_address)
print("timezone: \n" + str(timezone) + str('\n'))

validate = client.validate(validate_address)
print("validate: \n" + str(validate) + str('\n'))

For convenience, all request performing module methods are wrapped inside the client class.

Dry run

Although errors in query creation should be handled quite decently, you can do a dry run to print the request and its parameters:

import addresshunt

autocomplete_address = "11 NICHOLSON STREET"

client = addresshunt.Client(api_key='') # Specify your personal API key
address_list = client.autocomplete(autocomplete_address, dry_run='true')

Support

For issues/bugs/enhancement suggestions, please use https://github.com/AddressHunt/addresshunt-py/issues.

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

addresshunt-1.1.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file addresshunt-1.1.tar.gz.

File metadata

  • Download URL: addresshunt-1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.4

File hashes

Hashes for addresshunt-1.1.tar.gz
Algorithm Hash digest
SHA256 1eb9e481aa12b73adad83d2ad47debe2d67386455458c4e51c89b010d8a3c9ae
MD5 9b93cd84108d736cbf25a826255ceee3
BLAKE2b-256 10200b851ea059585cecf42c7547c07d0709e3cb16faa2b2a9fdd62e39ed1c7f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page