Skip to content

Releases: Geocodio/geocodio-library-python

v0.5.0 - Distance API Support

06 Jan 11:11

Choose a tag to compare

What's New

This release adds full support for the Geocodio Distance API, enabling distance calculations between geographic coordinates.

New Features

  • Distance API methods:

    • distance() - Calculate distances from a single origin to multiple destinations
    • distance_matrix() - Calculate distances from multiple origins to multiple destinations
    • Support for straightline (haversine) and driving distance modes
    • Support for miles and km units
    • Optional sorting by distance or duration
  • New Coordinate class for representing geographic coordinates with optional IDs

  • Distance parameters added to geocode() and reverse() methods for inline distance calculations

  • New type definitions: DistanceResponse, DistanceMatrixResponse, DistanceOrigin, DistanceDestination

  • New constants: DISTANCE_MODE_STRAIGHTLINE, DISTANCE_MODE_DRIVING, DISTANCE_UNITS_MILES, DISTANCE_UNITS_KM

Example Usage

from geocodio import Geocodio, Coordinate

client = Geocodio(api_key="YOUR_API_KEY")

# Calculate distances from White House to landmarks
response = client.distance(
    origin=Coordinate(38.8977, -77.0365, "white_house"),
    destinations=[
        Coordinate(38.8895, -77.0353, "monument"),
        Coordinate(38.9072, -77.0369, "capitol")
    ],
    mode="straightline",
    units="miles"
)

for dest in response.destinations:
    print(f"{dest.id}: {dest.distance_miles} miles")

Full Changelog: v0.4.0...v0.5.0

v0.4.0

19 Nov 16:24
939c0be

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.3.0...v0.4.0

v0.3.0

24 Oct 09:21

Choose a tag to compare

What's Changed

Bug Fixes

  • Fixed census field appends parsing to dynamically handle all census field types (#13)

Tests

  • Added test coverage for census field appends

Full Changelog: v0.2.0...v0.3.0

v0.2.0

08 Aug 16:02

Choose a tag to compare

Breaking Changes 🚨

This release simplifies the API by renaming the main client class from GeocodioClient to Geocodio, making it more consistent with other Geocodio SDKs and easier to use.

Migration Guide

Update your imports:

# Old
from geocodio import GeocodioClient
client = GeocodioClient(api_key="...")

# New  
from geocodio import Geocodio
client = Geocodio(api_key="...")

What's Changed

  • BREAKING: Renamed main client class from GeocodioClient to Geocodio for simplicity and consistency with other SDKs
    • All functionality remains the same
    • Only the class name has changed
    • Update imports and instantiation as shown above

Installation

pip install geocodio-library-python==0.2.0

Full Changelog

v0.1.0...v0.2.0

v0.1.0 - Initial Release

08 Aug 14:26

Choose a tag to compare

Initial Release 🎉

The first official release of the Python client library for the Geocodio API.

Features

  • Forward geocoding for single addresses and batch operations (up to 10,000 addresses)
  • Reverse geocoding for single coordinates and batch operations
  • List API support for managing large batch jobs
  • Field appending capabilities (census data, timezone, congressional districts, etc.)
  • Comprehensive error handling with structured exception hierarchy
  • Full test coverage with unit and end-to-end tests
  • Support for Geocodio Enterprise API via hostname parameter
  • Modern async-capable HTTP client using httpx
  • Type hints and dataclass models for better IDE support
  • GitHub Actions CI/CD pipeline for automated testing and publishing

Installation

pip install geocodio-library-python

Quick Start

from geocodio import GeocodioClient

client = GeocodioClient("YOUR_API_KEY")
response = client.geocode("1600 Pennsylvania Ave, Washington, DC")
print(response.results[0].formatted_address)

Full documentation available at https://www.geocod.io/docs/?python