Commit 3979c7f
feat(distance): add Distance API support (#21)
* feat(distance): add Distance API support
Add full Distance API support matching the PHP SDK implementation:
- Add Coordinate class for flexible coordinate input formats (string, tuple, dict)
- Add distance() method for single origin to multiple destinations (GET)
- Add distance_matrix() method for multiple origins × destinations (POST)
- Add async job methods for large distance matrix calculations:
- create_distance_matrix_job()
- distance_matrix_job_status()
- distance_matrix_jobs()
- get_distance_matrix_job_results()
- download_distance_matrix_job()
- delete_distance_matrix_job()
- Enhance geocode() and reverse() with distance parameters
- Add type-safe constants for mode, units, ordering, and sorting
- Add verify_ssl parameter to client for testing with self-signed certs
- Add comprehensive unit tests and E2E tests
- Update README with full Distance API documentation
All changes are backward compatible - existing code continues to work.
* fix(tests): add __init__.py to test subdirectories
Prevents pytest module name collision between unit and e2e test files
with the same name (e.g., test_distance.py in both directories).
* fix(tests): correct distance API test assertion for origin ID
The API does not return origin ID for GET /distance requests, only
destination IDs. Updated test to verify destination IDs instead.
* fix(distance): remove unused f-string prefixes
* chore: prepare release v0.5.0
- Bump version to 0.5.0
- Update CHANGELOG with Distance API features
---------
Co-authored-by: Mathias Hansen <me@codemonkey.io>1 parent 939c0be commit 3979c7f
12 files changed
Lines changed: 2531 additions & 63 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
10 | 25 | | |
11 | 26 | | |
12 | 27 | | |
| |||
39 | 54 | | |
40 | 55 | | |
41 | 56 | | |
42 | | - | |
| 57 | + | |
| 58 | + | |
43 | 59 | | |
44 | 60 | | |
0 commit comments