Official Python SDK for the Georavity Geospatial API — routing, geocoding, and map tiles.
Project description
georavity
Official Python SDK for the Georavity Geospatial API — routing, geocoding, isochrones, and more.
Installation
pip install georavity
Quick Start
from georavity import Georavity
geo = Georavity("gr_your_api_key")
# Route between two points
route = geo.route(
locations=[
{"lon": 13.388860, "lat": 52.517037}, # Berlin Hauptbahnhof
{"lon": 13.397634, "lat": 52.529407}, # Mauerpark
],
costing="auto",
)
print(f"Distance: {route['trip']['summary']['length']} km")
print(f"Duration: {route['trip']['summary']['time']} seconds")
API Reference
Routing
# Standard route
route = geo.route(
locations=[{"lat": 52.52, "lon": 13.40}, {"lat": 48.85, "lon": 2.35}],
costing="auto", # "auto" | "bicycle" | "pedestrian" | "truck"
)
# Optimized route (TSP)
optimized = geo.optimized_route(
locations=[
{"lat": 52.52, "lon": 13.40},
{"lat": 48.85, "lon": 2.35},
{"lat": 51.50, "lon": -0.12},
],
costing="auto",
)
# Distance/time matrix
matrix = geo.matrix(
sources=[{"lat": 52.52, "lon": 13.40}],
targets=[{"lat": 48.85, "lon": 2.35}, {"lat": 51.50, "lon": -0.12}],
costing="auto",
)
# Isochrone
iso = geo.isochrone(
locations=[{"lat": 52.52, "lon": 13.40}],
costing="auto",
contours=[{"time": 15}, {"time": 30}],
polygons=True,
)
Geocoding
# Forward geocode
results = geo.geocode("Brandenburg Gate, Berlin")
# With focus point (biases results near the given location)
results = geo.geocode("coffee", focus_lat=52.52, focus_lon=13.40)
# Reverse geocode
place = geo.reverse(lat=52.5163, lon=13.3777)
# Autocomplete
suggestions = geo.autocomplete("Bran", focus_lat=52.52, focus_lon=13.40)
Error Handling
from georavity import Georavity, GeoravityError
try:
route = geo.route(...)
except GeoravityError as e:
print(f"API Error [{e.code}]: {e}")
print(f"HTTP Status: {e.status}")
License
MIT — georavity.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
georavity-1.0.0.tar.gz
(4.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file georavity-1.0.0.tar.gz.
File metadata
- Download URL: georavity-1.0.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19dc20a849574245fa42d382ecf10c75828d7668feb73f0f6fae351d79f4f5d6
|
|
| MD5 |
a14e3ca8768ceee0d8fbdcfa5e2a8102
|
|
| BLAKE2b-256 |
6d4533637182820a18977bc2174661f63e53abbdfc8164b229673563d174fd8e
|
File details
Details for the file georavity-1.0.0-py3-none-any.whl.
File metadata
- Download URL: georavity-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61728db300364ee94d2d2accb189ca79580da44d6ebe1ea2cff6bc1d02705c2b
|
|
| MD5 |
75d36a0385dd348bb231e0e69292d52f
|
|
| BLAKE2b-256 |
17aa7c64926d7c57deda8c26db5e738f1d079824feea26d1b539754c43fe08a2
|