Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Updated default API version from v1.9 to v1.10

## [0.5.1] - 2026-02-18

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions smoke_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main():
logger.info("Creating a new list...")
file_content = "Zip\n20003\n20001"
# --- Capture request details ---
logger.info("REQUEST: POST /v1.9/lists")
logger.info("REQUEST: POST /v1.10/lists")
logger.info(f"Request params: {{'api_key': '***', 'direction': 'forward', 'format': '{{A}}'}}")
logger.info(f"Request files: {{'file': ('smoke_test_list.csv', {repr(file_content)})}}")
new_list_response = client.create_list(
Expand All @@ -66,7 +66,7 @@ def main():
format_="{{A}}"
)
# --- Capture response details ---
logger.info("RESPONSE: POST /v1.9/lists")
logger.info("RESPONSE: POST /v1.10/lists")
print_headers_and_body("Response", {
"id": new_list_response.id,
"file": new_list_response.file,
Expand Down
2 changes: 1 addition & 1 deletion src/geocodio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


class Geocodio:
BASE_PATH = "/v1.9" # keep in sync with Geocodio's current version
BASE_PATH = "/v1.10" # keep in sync with Geocodio's current version
DEFAULT_SINGLE_TIMEOUT = 5.0
DEFAULT_BATCH_TIMEOUT = 1800.0 # 30 minutes
LIST_API_TIMEOUT = 60.0
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def test_distance_basic(self, client, httpx_mock):
"""Test basic distance calculation."""
def response_callback(request):
assert request.method == "GET"
assert "/v1.9/distance" in str(request.url)
assert "/v1.10/distance" in str(request.url)
return httpx.Response(200, json=sample_distance_response())

httpx_mock.add_callback(callback=response_callback)
Expand Down Expand Up @@ -464,7 +464,7 @@ def sample_job_status_response():
"name": "My Job",
"status": "COMPLETED",
"progress": 100,
"download_url": "https://api.geocod.io/v1.9/distance-jobs/123/download",
"download_url": "https://api.geocod.io/v1.10/distance-jobs/123/download",
"total_calculations": 4,
"calculations_completed": 4,
"origins_count": 2,
Expand Down Expand Up @@ -502,7 +502,7 @@ def sample_jobs_list_response():
"current_page": 1,
"from": 1,
"to": 2,
"path": "/v1.9/distance-jobs",
"path": "/v1.10/distance-jobs",
"per_page": 10
}

Expand Down Expand Up @@ -656,7 +656,7 @@ def test_geocode_with_destinations(self, client, httpx_mock):
"""Test geocode with destination parameter."""
def response_callback(request):
url_str = str(request.url)
assert "/v1.9/geocode" in url_str
assert "/v1.10/geocode" in url_str
assert "destinations%5B%5D" in url_str or "destinations[]" in url_str.replace("%5B", "[").replace("%5D", "]")
return httpx.Response(200, json=sample_geocode_with_distance_response())

Expand All @@ -673,7 +673,7 @@ def test_geocode_with_distance_mode(self, client, httpx_mock):
"""Test geocode with distance mode parameter."""
def response_callback(request):
url_str = str(request.url)
assert "/v1.9/geocode" in url_str
assert "/v1.10/geocode" in url_str
assert "distance_mode=driving" in url_str
return httpx.Response(200, json=sample_geocode_with_distance_response())

Expand All @@ -689,7 +689,7 @@ def test_geocode_with_distance_units(self, client, httpx_mock):
"""Test geocode with distance units parameter."""
def response_callback(request):
url_str = str(request.url)
assert "/v1.9/geocode" in url_str
assert "/v1.10/geocode" in url_str
assert "distance_units=km" in url_str
return httpx.Response(200, json=sample_geocode_with_distance_response())

Expand All @@ -714,7 +714,7 @@ def test_reverse_with_destinations(self, client, httpx_mock):
"""Test reverse geocode with destination parameter."""
def response_callback(request):
url_str = str(request.url)
assert "/v1.9/reverse" in url_str
assert "/v1.10/reverse" in url_str
assert "destinations%5B%5D" in url_str or "destinations[]" in url_str.replace("%5B", "[").replace("%5D", "]")
return httpx.Response(200, json=sample_geocode_with_distance_response())

Expand All @@ -731,7 +731,7 @@ def test_reverse_with_distance_mode(self, client, httpx_mock):
"""Test reverse geocode with distance mode parameter."""
def response_callback(request):
url_str = str(request.url)
assert "/v1.9/reverse" in url_str
assert "/v1.10/reverse" in url_str
assert "distance_mode=straightline" in url_str
return httpx.Response(200, json=sample_geocode_with_distance_response())

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def _add_err(httpx_mock, status_code):
# this should actually make the request and see and error response
# but we are mocking it here for testing purposes
httpx_mock.add_response(
url=httpx.URL("https://api.test/v1.9/geocode", params={"q": "bad input"}),
url=httpx.URL("https://api.test/v1.10/geocode", params={"q": "bad input"}),
match_headers={"Authorization": "Bearer TEST_KEY"},
json={"error": "boom"},
status_code=status_code,
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/test_geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/geocode", params={"q": "1109 N Highland St, Arlington, VA"}),
url=httpx.URL("https://api.test/v1.10/geocode", params={"q": "1109 N Highland St, Arlington, VA"}),
match_headers={"Authorization": "Bearer TEST_KEY"},
)

Expand Down Expand Up @@ -140,7 +140,7 @@ def batch_response_callback(request):

httpx_mock.add_callback(
callback=batch_response_callback,
url=httpx.URL("https://api.test/v1.9/geocode"),
url=httpx.URL("https://api.test/v1.10/geocode"),
match_headers={"Authorization": "Bearer TEST_KEY"},
)

Expand Down Expand Up @@ -172,7 +172,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/geocode", params={
url=httpx.URL("https://api.test/v1.10/geocode", params={
"street": "1109 N Highland St",
"city": "Arlington",
"state": "VA"
Expand Down Expand Up @@ -229,7 +229,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/geocode", params={
url=httpx.URL("https://api.test/v1.10/geocode", params={
"q": "1109 Highland St, Arlington, VA",
"fields": "timezone,cd"
}),
Expand Down Expand Up @@ -292,7 +292,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/geocode", params={
url=httpx.URL("https://api.test/v1.10/geocode", params={
"q": "1109 Highland St, Arlington, VA",
"limit": "2"
}),
Expand Down Expand Up @@ -371,7 +371,7 @@ def batch_response_callback(request):

httpx_mock.add_callback(
callback=batch_response_callback,
url=httpx.URL("https://api.test/v1.9/geocode"),
url=httpx.URL("https://api.test/v1.10/geocode"),
match_headers={"Authorization": "Bearer TEST_KEY"},
)

Expand Down Expand Up @@ -478,7 +478,7 @@ def batch_response_callback(request):

httpx_mock.add_callback(
callback=batch_response_callback,
url=httpx.URL("https://api.test/v1.9/geocode", params={"fields": "timezone,cd"}),
url=httpx.URL("https://api.test/v1.10/geocode", params={"fields": "timezone,cd"}),
match_headers={"Authorization": "Bearer TEST_KEY"},
)

Expand Down Expand Up @@ -558,7 +558,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/geocode", params={
url=httpx.URL("https://api.test/v1.10/geocode", params={
"street": "1640 Main St",
"city": "Sheldon",
"state": "VT",
Expand Down Expand Up @@ -671,7 +671,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/geocode", params={
url=httpx.URL("https://api.test/v1.10/geocode", params={
"q": "600 Santa Ray Ave, Oakland CA 94610",
"fields": "stateleg"
}),
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/reverse", params={"q": "38.886672,-77.094735"}),
url=httpx.URL("https://api.test/v1.10/reverse", params={"q": "38.886672,-77.094735"}),
match_headers={"Authorization": "Bearer TEST_KEY"},
)

Expand Down Expand Up @@ -110,7 +110,7 @@ def batch_response_callback(request):

httpx_mock.add_callback(
callback=batch_response_callback,
url=httpx.URL("https://api.test/v1.9/reverse"),
url=httpx.URL("https://api.test/v1.10/reverse"),
match_headers={"Authorization": "Bearer TEST_KEY"},
)

Expand Down Expand Up @@ -162,7 +162,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/reverse", params={
url=httpx.URL("https://api.test/v1.10/reverse", params={
"q": "38.886672,-77.094735",
"fields": "timezone,cd"
}),
Expand Down Expand Up @@ -225,7 +225,7 @@ def response_callback(request):

httpx_mock.add_callback(
callback=response_callback,
url=httpx.URL("https://api.test/v1.9/reverse", params={
url=httpx.URL("https://api.test/v1.10/reverse", params={
"q": "38.886672,-77.094735",
"limit": "2"
}),
Expand All @@ -244,7 +244,7 @@ def response_callback(request):
def test_reverse_invalid_coordinate(client, httpx_mock):
# Arrange: stub the API call with error response
httpx_mock.add_response(
url=httpx.URL("https://api.test/v1.9/reverse", params={
url=httpx.URL("https://api.test/v1.10/reverse", params={
"q": "invalid,coordinate"
}),
match_headers={"Authorization": "Bearer TEST_KEY"},
Expand Down
Loading