Releases: Geocodio/geocodio-library-python
v0.5.0 - Distance API Support
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 destinationsdistance_matrix()- Calculate distances from multiple origins to multiple destinations- Support for
straightline(haversine) anddrivingdistance modes - Support for
milesandkmunits - Optional sorting by distance or duration
-
New
Coordinateclass for representing geographic coordinates with optional IDs -
Distance parameters added to
geocode()andreverse()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
What's Changed
- fix(parser): support nested field structures with backward compatibility by @sylvesterdamgaard in #18
New Contributors
- @sylvesterdamgaard made their first contribution in #18
Full Changelog: v0.3.0...v0.4.0
v0.3.0
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
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
GeocodioClienttoGeocodiofor 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.0Full Changelog
v0.1.0 - Initial Release
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-pythonQuick 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