API Reference

GeosupportSuggest

class suggest.GeosupportSuggest(geosupport=None, func='AP', max_workers=3, rate_limit=0, parser_options=None, use_cache=False, cache_size=1000, cache_ttl=3600)[source]

Bases: object

Provides address suggestions from NYC Geosupport.

__enter__()[source]
__exit__(exc_type, exc_val, exc_tb)[source]
__init__(geosupport=None, func='AP', max_workers=3, rate_limit=0, parser_options=None, use_cache=False, cache_size=1000, cache_ttl=3600)[source]

Initialize GeosupportSuggest.

Parameters:
  • geosupport – Geosupport object

  • func – Function to use (‘AP’ or ‘1B’)

  • max_workers – Max parallel workers

  • rate_limit – Seconds between API calls (0 for no limit)

  • parser_options – Dictionary of options to pass to nyc-parser

  • use_cache – Enable caching of results

  • cache_size – Maximum number of items in memory cache

  • cache_ttl – Time-to-live in seconds for cached items

clear()[source]

Clear all results and similar names.

format_address(result)[source]

Format a result as a standard address string.

normalize_results(results: List[Dict[str, Any]]) List[Dict[str, Any]][source]

Normalize results to a consistent format.

Handles potential missing fields and standardizes structure.

suggestions(*args, **kwargs)[source]
suggestions_batch(addresses, parallel=False)[source]

Process multiple addresses in batch.

to_geojson(results: List[Dict[str, Any]]) Dict[str, Any][source]

Convert results to GeoJSON format.

Parameters:

results – Address results to convert

Returns:

GeoJSON feature collection

ThreadSafeMemoryCache

AddressFormatter

Constants

suggest.VALID_BOROUGH_CODES: Set[int]

Valid borough codes (1-5)

Type Definitions

# Type definitions for common structures
AddressResult = Dict[str, Any]
AddressList = List[AddressResult]
GeoJSON = Dict[str, Any]
NormalizedAddress = Dict[str, Any]
CoordinatePair = Tuple[float, float]