Retrieve address suggestions from Geosupport using python-geosupport and a single input address.
- Thread-safe memory caching for improved performance
- Parallel processing of address queries
- GeoJSON export of geocoding results
- Address normalization with consistent formatting
- Borough code validation
- Rate limiting for API protection
- Context manager support
- Batch address processing
Full documentation is available at geosupport-suggest.readthedocs.io.
$ pip install geosupport-suggestor clone this repo, cd into it and
$ pip install .from geosupport import Geosupport
from suggest import GeosupportSuggest
# create a Geosupport object
g = Geosupport()
# create a GeosupportSuggest object using Geosupport
s = GeosupportSuggest(g)
# Get suggestions
results = s.suggestions('100 Gold')
# Print formatted addresses
for result in results:
print(s.format_address(result))Caching for improved performance:
# Enable caching
s = GeosupportSuggest(g, use_cache=True)
# First call makes API request
results1 = s.suggestions('100 Gold St')
# Second call uses cache
results2 = s.suggestions('100 Gold St') # Much fasterConvert results to GeoJSON:
# Get address suggestions
results = s.suggestions('350 5th Ave') # Empire State Building
# Convert to GeoJSON for mapping
geojson = s.to_geojson(results)Process multiple addresses:
addresses = [
'100 Gold St',
'350 5th Ave',
{'address': '1 Police Plaza', 'borough_code': 1} # With borough code
]
# Process all addresses (with parallel execution)
batch_results = s.suggestions_batch(addresses, parallel=True)Issues and PRs welcome. See Contributing for details.
MIT