Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
arnasbr committed Sep 26, 2024
1 parent 30e1278 commit cfc4756
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 57 deletions.
78 changes: 21 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,26 @@ pip install traveltime-google-comparison
```

## Setup
Provide credentials for the APIs via environment variables.

For Google Maps API:

```bash
export GOOGLE_API_KEY=[Your Google Maps API Key]
```

For TomTom API:

```bash
export TOMTOM_API_KEY=[Your TomTom API Key]
```

For HERE API:

```bash
export HERE_API_KEY=[Your HERE API Key]
```

For Mapbox API:

```bash
export MAPBOX_API_KEY=[Your Mapbox API Key]
```

For OpenRoutes API:

```bash
export OPENROUTES_API_KEY=[Your OpenRoutes API Key]
```

For OSRM API: OSRM does not require a key.

For TravelTime API:
```bash
export TRAVELTIME_APP_ID=[Your TravelTime App ID]
export TRAVELTIME_API_KEY=[Your TravelTime API Key]
Provide credentials and desired max requests per minute for the APIs inside the `config.json` file.
You can also disable unwanted APIs by changing the `enabled` value to `false`.

```json
{
"traveltime": {
"app-id": "<your-app-id>",
"api-key": "<your-api-key>",
"max-rpm": "60"
},
"api-providers": [
{
"name": "google",
"enabled": true,
"api-key": "<your-api-key>",
"max-rpm": "60"
},
...other providers
]
}
```

## Usage
Expand Down Expand Up @@ -104,26 +86,8 @@ Required arguments:
- `--time-zone-id [Time zone ID]`: non-abbreviated time zone identifier in which the time values are specified.
For example: `Europe/London`. For more information, see [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).



Optional arguments:
- `--google-max-rpm [int]`: Set max number of parallel requests sent to Google API per minute. Default is 60.
It is enforced on per-second basis, to avoid bursts.
- `--tomtom-max-rpm [int]`: Set max number of parallel requests sent to TomTom API per minute. Default is 60.
It is enforced on per-second basis, to avoid bursts.
- `--mapbox-max-rpm [int]`: Set max number of parallel requests sent to Mapbox API per minute. Default is 60.
It is enforced on per-second basis, to avoid bursts.
- `--here-max-rpm [int]`: Set max number of parallel requests sent to HERE API per minute. Default is 60.
It is enforced on per-second basis, to avoid bursts.
- `--osrm-max-rpm [int]`: Set max number of parallel requests sent to OSRM API per minute. Default is 60.
It is enforced on per-second basis, to avoid bursts.
- `--openroutes-max-rpm [int]`: Set max number of parallel requests sent to OpenRoutes API per minute. Default is 60.
It is enforced on per-second basis, to avoid bursts.
- `--traveltime-max-rpm [int]`: Set max number of parallel requests sent to TravelTime API per minute. Default is 60.
It is enforced on per-second basis, to avoid bursts.
- `--providers [providers]`: The providers you want to compare to TravelTime (e.g., --providers google mapbox).
Possible options: google, tomtom, here, mapbox, osrm, openroutes. TravelTime is included regardless of input.
By default all possible providers are included.
- `--config [Config file path]`: Path to the config file. Default - ./config.json

Example:

Expand Down
45 changes: 45 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"traveltime": {
"app-id": "<your-app-id>",
"api-key": "<your-api-key>",
"max-rpm": "60"
},
"api-providers": [
{
"name": "google",
"enabled": true,
"api-key": "<your-api-key>",
"max-rpm": "60"
},
{
"name": "tomtom",
"enabled": true,
"api-key": "<your-api-key>",
"max-rpm": "60"
},
{
"name": "here",
"enabled": true,
"api-key": "<your-api-key>",
"max-rpm": "60"
},
{
"name": "mapbox",
"enabled": true,
"api-key": "<your-api-key>",
"max-rpm": "60"
},
{
"name": "osrm",
"enabled": true,
"api-key": "not-needed!",
"max-rpm": "60"
},
{
"name": "openroutes",
"enabled": true,
"api-key": "<your-api-key>",
"max-rpm": "20"
}
]
}

0 comments on commit cfc4756

Please sign in to comment.