Skip to content

Commit a49120a

Browse files
author
Jakob Stolze
committed
refactor: examples to use most recent client
1 parent 10cc5cb commit a49120a

9 files changed

+3354
-44489
lines changed

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ These examples show common usages of this library.
5959
import openrouteservice as ors
6060
from pprint import pprint
6161

62-
# Configure API key authorization:
63-
configuration = ors.Configuration()
64-
configuration.api_key['Authorization'] = "YOUR_API_KEY"
65-
6662
# create an instance of the API class
67-
directionsApi = ors.DirectionsServiceApi(ors.ApiClient(configuration))
63+
directionsApi = ors.DirectionsServiceApi(
64+
ors.apiClient(apiKey="YOUR_API_KEY") # set your api key here
65+
)
6866

6967
# create request body
7068
body = ors.DirectionsService(
@@ -85,11 +83,10 @@ except ors.rest.ApiException as e:
8583
import openrouteservice as ors
8684
from pprint import pprint
8785

88-
# Configure host
89-
configuration = ors.Configuration()
90-
configuration.host = "http://localhost:8080/ors"
86+
isochronesApi = ors.IsochronesServiceApi(
87+
ors.apiClient(host="http://localhost:8080/ors") # set host to your local instance
88+
)
9189

92-
isochronesApi = ors.IsochronesServiceApi(ors.ApiClient(configuration))
9390
body = ors.IsochronesProfileBody(
9491
locations=[[8.681495,49.41461],[8.686507,49.41943]],
9592
range=[300]

0 commit comments

Comments
 (0)